Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 140
  • Last Modified:

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
0
tomcruisew
Asked:
tomcruisew
1 Solution
 
vbWayneCommented:
MSDN:  datediff function
0
 
hesCommented:
Dim CurrentDate
CurrentDate = Format(Now,"mm/dd/yyyy")

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

0
 
wesleystewartCommented:
Date() will return the current system date:

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

Wes
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

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now