Access - format date/time to date

I'm trying to do a query to remove the time aspect so that it just looks at the date alone.

and last_contact < format(now(), 'mm/dd/yy)-2

Open in new window


How do I fix this?  I wanna go back 2 days on the date by itself, not including the time.

last_contact is a date/time field.
patriotpacerAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Dale FyeConnect With a Mentor Commented:
AND DateValue([last_contact]) < DateAdd("d", -2, date())
0
 
patriotpacerAuthor Commented:
Thx.

Anything I need to change to put this in SQL?  I'm getting a data type mismatch error.
0
 
Dale FyeCommented:
I assumed that the syntax in your original post was a part of a SQL string WHERE clause.

If you are getting a data type error, then it is likely that [last_contact] is a string, not a date.

Try:

And datevalue(cdate([last_contact])) < dateadd("d", -2, date())
0
 
patriotpacerAuthor Commented:
Thx!
0
 
Dale FyeCommented:
Welcome!
0
All Courses

From novice to tech pro — start learning today.