08-25-04 10:58 PM
Jay wrote on 25 aug 2004 in microsoft.public.inetserver.asp.general:
> I am trying to compare a date in my database to the current date. My
> SQL statement is:
>
> sqltemp5="select * from users where dateclosed <= '" & date & "'"
>
> What I am trying to accomplish is exclude records where the dateclosed
> field is older than todays date. Such as if dateclosed = 6/30/2004
> then today being 08/25/2004 that record should be excluded.
>
Depending on the type of data base and data base connection, which you
really should state with such question, usually a date in SQL has to be
enclosed in #..# and should be in the form of yy/mm/dd so:
date = "2004/08/25"
sqltemp5="select * from users where dateclosed <= #" & date & "#"
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)
[ Post a follow-up to this message ]
|