Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query comparing dates

Status
Not open for further replies.

lbrechler

Programmer
May 17, 2001
44
US
I'm sure this must be an FAQ, but I can't seem to find it...

I'm using VB6 to query an Access 2000 database. I want to pull all records from a particular table "TEST" whose field "DATE" is greater than today (basically, in the future). I thought that

"SELECT * from TEST where DATE > " & FormatDateTime(Now, vbShortDate)& " ORDER BY DATE ASC"

was working, but today when I check, there are no results (even though there should be at least 3).

Any suggestions?

Thanks,
Lindsay
 
Think I figured it out...

I actually had: "SELECT * from TEST where rst!DATE > " & FormatDateTime(Now, vbShortDate)& " ORDER BY DATE ASC "

But needed:

"SELECT * from TEST where CDate(rst!DATE) > " & FormatDateTime(Now, vbShortDate)& " ORDER BY DATE ASC "

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top