Link to home
Start Free TrialLog in
Avatar of davewalter1
davewalter1

asked on

Microsoft Access Yesterday's Date

I need to pull records entered "yesterday," from a table of records entered via a dotnet form. The date field in the table is formatted as Short Date, but the values coming in from the Web form include the time with the date.

Date()-1 returns no records, apparently because of the time component in the field. If I enter a date directly into the table, the query works, I'm assuming because there's just a date and no time.

Without changing the data entry form, is there a way to query these records and ignore the time?

Thank you!
ASKER CERTIFIED SOLUTION
Avatar of Phillip Burton
Phillip Burton

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Phillip Burton
Phillip Burton

alternatively, you can do the criteria of >=int(now())-1 and <int(now())
Avatar of davewalter1

ASKER

Thank you! Worked perfectly.
Avatar of Dale Fye
DateValue([yourField]) = Date() - 1

or

([yourField] >= Date() - 1) AND ([yourField] < Date())