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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing dates

Status
Not open for further replies.

LaurelLee

Programmer
Mar 2, 2004
117
US
I am attempting to write an if statement something like this:
Code:
If DLookup("FridayDate", "qryGetFridayDate")=Now() then
do something.

This is never evaluating to true because, as I see it, now() includes the date and time, and my field is a short date. So, I tried this:

Code:
If DLookup("FridayDate", "qryGetFridayDate")=CVDate(format(Now(), mm/dd/yyyy)) then
do something.

When this runs I get a runtime error simply stating "Overflow".


Any ideas on how I can accomplish this? Thanks!


___________________________________________________________
With your thoughts you create the world--Shakyamuni Buddha
 
Instead of Now(), try just date

ChaZ

"When religion and politics ride in the same cart...the whirlwind follows."
Frank Herbert
 
Yup, it is official, I need to go home.

Thanks!

___________________________________________________________
With your thoughts you create the world--Shakyamuni Buddha
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top