mongkb
08-14-2006, 09:34 PM
Help - about SELECT by date in Access
Hi all, I've created a table in Access and I assigned the date format to a field , named 'bdate', to "dd/mm/yyyy", the 'bdate' records are:
1. 23/07/2006
2. 02/08/2006
3. 15/08/2006
Here is the ASP Code:
<%session.lcid=2057%>
<%
selDate = FormatDateTime(selDate, 2)
strSQL = "SELECT * FROM tblList WHERE bdate = #" & selDate & "#"
Set rs = ObjConn.Execute(strSQL)
%>
Problem:
This SQL works fine with record no.1 and 3, but select no.2 will result EOF, but if I change the selDate to 08/02/2006, the record no.2 will be found.
I've made a debug page here, it clearly shows the detail of the issue:
http://www.mong.hk/test/c.asp
Can someone help me to solve this problem, thank you very much for your time and sorry for my poor English.
Hi all, I've created a table in Access and I assigned the date format to a field , named 'bdate', to "dd/mm/yyyy", the 'bdate' records are:
1. 23/07/2006
2. 02/08/2006
3. 15/08/2006
Here is the ASP Code:
<%session.lcid=2057%>
<%
selDate = FormatDateTime(selDate, 2)
strSQL = "SELECT * FROM tblList WHERE bdate = #" & selDate & "#"
Set rs = ObjConn.Execute(strSQL)
%>
Problem:
This SQL works fine with record no.1 and 3, but select no.2 will result EOF, but if I change the selDate to 08/02/2006, the record no.2 will be found.
I've made a debug page here, it clearly shows the detail of the issue:
http://www.mong.hk/test/c.asp
Can someone help me to solve this problem, thank you very much for your time and sorry for my poor English.