Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2033
  • Last Modified:

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!
0
davewalter1
Asked:
davewalter1
  • 2
1 Solution
 
Phillip BurtonDirector, Practice Manager and Computing ConsultantCommented:
int(myDate) gives you the date but not the time.
0
 
Phillip BurtonDirector, Practice Manager and Computing ConsultantCommented:
alternatively, you can do the criteria of >=int(now())-1 and <int(now())
0
 
davewalter1Author Commented:
Thank you! Worked perfectly.
0
 
Dale FyeCommented:
DateValue([yourField]) = Date() - 1

or

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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now