Query Criteria Question

G

GOL

I'm attempting to run a query for a weeks worth of data. But, I only need
information from 2:00 and after on Monday 2/7/2007 (>=2:00:00 PM) till Friday
2/11/2005 up until 2:00 (<2:00:00 PM) All the data on Tuesday, Wed., Thurs.,
I need, but these times don't matter. I've tried setting criteria with dates
and times, but can't seem to pinpoint the criteria I need. Any help on what
to do is appreciated.
 
T

Tom Wickerath

You can use the following (I'm assuming you meant 2005, not 2007, as the year for the first
date):
=#02/07/2005 2:00:00 PM# And <#02/11/2005 2:00:00 PM#


If you want to catch a record that is exactly at 2:00 PM on the 11th, then you can use this:

Between #02/07/2005 2:00:00 PM# And #02/11/2005 2:00:00 PM#

Tom
__________________________________


I'm attempting to run a query for a weeks worth of data. But, I only need
information from 2:00 and after on Monday 2/7/2007 (>=2:00:00 PM) till Friday
2/11/2005 up until 2:00 (<2:00:00 PM) All the data on Tuesday, Wed., Thurs.,
I need, but these times don't matter. I've tried setting criteria with dates
and times, but can't seem to pinpoint the criteria I need. Any help on what
to do is appreciated.
 
K

Ken Snell [MVP]

Assuming that you're storing the date and time in the same field, this would
be the criterion expression:

Between #2/7/05 2:00PM# And #2/11/05 1:59:59PM#
 
G

GOL

Ken and Tom, sorry I did not clarify. My date and times are in separate
fields...due to other reasons with our order system. That seems to be the
problem. I have a criterion set up that returns the correct information with
2 consecutive days (After 2 on Monday and before 2 on Tuesday), but cannot
figure one for more than one day as I specified in my first question. Any
further suggestions are again appreciated as I am still struggling w/it.
 
D

Douglas J. Steele

Add them together (using the + operator) and you can use their suggestions.

In actual fact, you really should combine them into a single field. If you
have some reason to separate them (for export to other systems, for
instance), you can use DateValue and TimeValue in a query to split them.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)
 
Top