Between Date AND Time Parameter Query (1 Viewer)

EdwardsC

New member
Local time
Today, 11:02
Joined
Jul 10, 2019
Messages
21
I can set up a parameter query to filter between dates but is there a way to filter between dates & times I.e 06/26/22 08:00:00 AM to 06/27/22 08:00:00 PM?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 19:02
Joined
Feb 19, 2013
Messages
16,615
yes - the same way - if your date and time fields are separate, then just add them together
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 13:02
Joined
Feb 28, 2001
Messages
27,188
A Date field holding only a date is merely a Date field for which the fraction has been removed - because the fraction represents time of day in the same field.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 02:02
Joined
May 7, 2009
Messages
19,245
I can set up a parameter query to filter between dates but is there a way to filter between
yes you can and i don't think you need to separate the date and time components to another field.
but don't use Between in your criteria.
use, this format for your criteria:

>=[StartDate] And <=[EndDate]

and you must type Exact format as you have on the date field.
 
Last edited:

Pat Hartman

Super Moderator
Staff member
Local time
Today, 14:02
Joined
Feb 19, 2002
Messages
43,276
The dates are stored internally as double precision numbers with the integer being the number of days after or before (negative numbers) 12/30/1899 and the decimal is the fraction of the day. So, .5 is noon and .25 is 6 AM and .75 is 6 PM. It is those pesky tiny fractions that may make the Between not work as you expect it to so the >= and <= method is always safer.
 

Users who are viewing this thread

Top Bottom