Solved

System Date

Posted on 2000-03-30
4
135 Views
Last Modified: 2010-05-02
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
Comment
Question by:tomcruisew
4 Comments
 
LVL 1

Expert Comment

by:vbWayne
ID: 2669556
MSDN:  datediff function
0
 
LVL 20

Expert Comment

by:hes
ID: 2669704
Dim CurrentDate
CurrentDate = Format(Now,"mm/dd/yyyy")

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

0
 
LVL 4

Accepted Solution

by:
wesleystewart earned 15 total points
ID: 2670185
Date() will return the current system date:

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

Wes
0
 
LVL 9

Expert Comment

by:cymbolic
ID: 2670382
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question