System Date

What is the sintax that I can use to compare a Date Column from access to the System Date ? Like this :

adodc1.recordset.open "select * from table where field1 < date"

When I use two date columns no problems.

Thanks in advance for any help
tomcruisewAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
wesleystewartConnect With a Mentor Commented:
Date() will return the current system date:

adodc1.recordset.open "select * from table where field1 < #" & Date() & "#"

Wes
0
 
vbWayneCommented:
MSDN:  datediff function
0
 
hesCommented:
Dim CurrentDate
CurrentDate = Format(Now,"mm/dd/yyyy")

adodc1.recordset.open "select * from table where field1 < #" & CurrentDate & "#"

0
 
cymbolicCommented:
Be aware that datetime fields will assume you mean just after midnight on the day you compare.  So if you want to include items on that day, you need to say something like #12/31/99 23:59# or just say <#1/1/00#
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.