Query Criteria

hmongie

Registered User.
Local time
Today, 16:46
Joined
May 17, 2003
Messages
99
I need help creating a time criteria for a query. What I would like to do is create a time criteria where the query will retrieve data from a table from the previous date and the current date within a particular time frame.

what I have now(which doesn't work)...

Between <previous date> #11:00:00 PM# And Date()#7:00:00 AM#

Any help would be appreciated!!! Thanx!
 
Date and Time are numeric. You can use the + sign to join them. (Date()-1) returns the previous date. So the criteria for the DateTime field is:-

Between (Date()-1)+#11:00:00 PM# And Date()+#7:00:00 AM#


Edited: Added the explanations.
 
Last edited:
Did some research with your problem and my best guess is to use the following: create a QueryForm with 2 Textboxes which represent the beginning and end date/times you want to test against. Then in the Query use the following CRITERIA statement: Between [Forms]![queryformname]![text0] And [Forms]![queryformname]![text2]. This should solve your problem. HTH JT
 
GOT IT !!!

YEAHHHHHHH !!!

Hey EMP it works!!! Thanks a million. Couldn't figure it out. Once again, thanks!!!

YEAHHHHHHH !!! (A sigh of relief)...........................
 

Users who are viewing this thread

Back
Top Bottom