
September 1st, 2003, 06:58 AM
|
|
Junior Member
|
|
Join Date: Sep 2003
Posts: 7
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
ASP - SQL comparing dates - plz HELP!
Hello! can anyone please help or had similar problems?
I have an Access database with a field named 'bid_close_date' (data type = 'Date/Time' - General Date: DD/MM/YYYY HH:MM:SS) in a table named tblplayers.
I am running the following Query, using NOW() - which I was hoping would return all the players from tblplayers whose bid_close_date is less than NOW().
SQL = "SELECT * FROM tblPlayers WHERE bid_close_date > # " & NOW &" # ;"
HOWEVER! The SQL only seems to be looking at the first part of the Date i.e. DD and not the rest of the date string. i.e. MM/YYYY HH:MM:SS
N.B. when I compare dates in VBscript it recognises the dates and the comparisons works. i.e. return the desired result.
<%
IF Now() > rs("Bid_close_date") THEN
Response.Write("THIS AUCTION CLOSED etc...")
End If
%>
If anyone has any suggestions I would be most grateful.
David
|