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!
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
alternatively, you can do the criteria of >=int(now())-1 and <int(now())
ASKER
Thank you! Worked perfectly.
DateValue([yourField]) = Date() - 1
or
([yourField] >= Date() - 1) AND ([yourField] < Date())
or
([yourField] >= Date() - 1) AND ([yourField] < Date())