compare date field to current date

M

Michael Haas

Need some hwlp with comparing a date field retrieved from an access
date base to the current date. Basically I'm looking to create and if
statement like:
If strArticleDate < = Current Date then
else...

Thanks for any help or feedback
Mike
 
M

Mike Haas

I'm having a problem witht he currentdate part:
if I substitute "02/15/2004" for CurrentDate it works
Do I need to format CurrentDate? how should I decalre it?
Thanks for the help again.
Mike
 
A

Aaron Bertrand [MVP]

You shouldn't have to worry about formatting.

WHERE dateColumn <= Date()

or better yet, if dateColumn has time information,

WHERE dateColumn < DATEADD("d", 1, Date())
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top