GPSPOW
asked on
Set filter in Access for DateTime - Yesterday
What is the syntax in an Access Query to set a criteria filter for a DateTime field for yesterday?
I tried Dateadd('d',-1,Date()) but that does not work.
Thanks
Glen
I tried Dateadd('d',-1,Date()) but that does not work.
Thanks
Glen
ASKER
Did not work.
I know if have data for 1/1/2014.
glen
I know if have data for 1/1/2014.
glen
is there Time in your date field ?
And how are you using this? Can you post the SQL or query grid?
And how are you using this? Can you post the SQL or query grid?
ASKER
I am using MS Access 2010.
The field AdmitDateTime has a DateTime format: 1/1/2014 12:14:00 AM
The field AdmitDateTime has a DateTime format: 1/1/2014 12:14:00 AM
So, looks time Time is being stored with date?
In that case, you need to use DateValue([AdmitDateTime]) to extract just the Date - and compare that against Dateadd("d",-1,Date())
In that case, you need to use DateValue([AdmitDateTime]) to extract just the Date - and compare that against Dateadd("d",-1,Date())
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
Dateadd("d",-1,Date())