How can you filter a [data + time] field by just date?

stell

Registered User.
Local time
Today, 07:52
Joined
Jun 14, 2017
Messages
15
So basically, I set up a macro using the now() function on a form. Now I want to write a query that filters those records by date. I can't quite figure it out because the field has both data AND time and when I set the criteria to =date() it gives me no results.

Any advice would be appreciated!
 
Wrap your date/time field in DateValue()


DateValue([DateTimeFieldName])
 
Perfect! Thank you
 
This will perform vastly better than applying a function to every value in the table:
Code:
WHERE [DateTimeField] >=Date() AND [DateTimeField] < Date() + 1
 

Users who are viewing this thread

Back
Top Bottom