Filtering out a time range

  • Thread starter Thread starter KK
  • Start date Start date
K

KK

I have a field in an MS Access db that contains a date and time. I
need to filter out a time range from that field eg. "6:00:00 am to
10:00:00 am" for all dates. How do I do this?

Thanks.
 
Use an additional calculated field like this ---
Expr1: [YourDateField]-Int([YourDateField])
and criteria of ---
Not Between #6:00:00 AM# And #10:00:00 AM#
 
Ok Karl, let me try this. Oh BTW, sorry to misinform but I actually
meant filter FOR 6:00 am to 10:00 am. So I probably remove "Not" from
your code in criteria.

Use an additional calculated field like this ---
Expr1: [YourDateField]-Int([YourDateField])
  and criteria of ---
Not Between #6:00:00 AM# And #10:00:00 AM#

--
KARL DEWEY
Build a little - Test a little



KK said:
I have a field in an MS Access db that contains a date and time. I
need to filter out a time range from that field eg. "6:00:00 am to
10:00:00 am" for all dates. How do I do this?
Thanks.- Hide quoted text -

- Show quoted text -
 
It doesn't seem to work. My field name is "Intervalending". When I
replace "YourDateField" with "Intervalending" in the code you gave and
run the query, I get a popup box that says "(Intervalending)" and has
a space for me to type in something. It doesn't just bring up the data
with filtered result. any idea?

Use an additional calculated field like this ---
Expr1: [YourDateField]-Int([YourDateField])
  and criteria of ---
Not Between #6:00:00 AM# And #10:00:00 AM#

--
KARL DEWEY
Build a little - Test a little



KK said:
I have a field in an MS Access db that contains a date and time. I
need to filter out a time range from that field eg. "6:00:00 am to
10:00:00 am" for all dates. How do I do this?
Thanks.- Hide quoted text -

- Show quoted text -
 
If the query ask for intervalending then it doesn't recognize that name as a
field name. Check the spelling of the field name.

--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..

It doesn't seem to work. My field name is "Intervalending". When I
replace "YourDateField" with "Intervalending" in the code you gave and
run the query, I get a popup box that says "(Intervalending)" and has
a space for me to type in something. It doesn't just bring up the data
with filtered result. any idea?

Use an additional calculated field like this ---
Expr1: [YourDateField]-Int([YourDateField])
and criteria of ---
Not Between #6:00:00 AM# And #10:00:00 AM#

--
KARL DEWEY
Build a little - Test a little



KK said:
I have a field in an MS Access db that contains a date and time. I
need to filter out a time range from that field eg. "6:00:00 am to
10:00:00 am" for all dates. How do I do this?
Thanks.- Hide quoted text -

- Show quoted text -
 
oh ok I figured out why. The field was a text field. so I changed it
to date/time and it worked. Thanks all.

If the query ask for intervalending then it doesn't recognize that name asa
field name.  Check the spelling of the field name.

--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
.


It doesn't seem to work. My field name is "Intervalending". When I
replace "YourDateField" with "Intervalending" in the code you gave and
run the query, I get a popup box that says "(Intervalending)" and has
a space for me to type in something. It doesn't just bring up the data
with filtered result. any idea?

Use an additional calculated field like this ---
Expr1: [YourDateField]-Int([YourDateField])
and criteria of ---
Not Between #6:00:00 AM# And #10:00:00 AM#
- Show quoted text -- Hide quoted text -

- Show quoted text -
 
Back
Top