Filter records with a combination of Time and Date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How would I set up a query to filter records based on time and date? I need
to run a report that I can specify a particular date and also the time of
that particular day to another particular date and time of day. Example, I
need to know how many gallons of fuel were pumped from a tank from 07:00 hrs.
on Sept. 9, 2005 to 13:12 hrs. on Sept16, 2005. I have used date to date
parameters many times, but not the combination of date and time. Is it even
possible with access?
Thanks
Woody
 
Thanks a million! It works perfect.
Woody

Chris2 said:
Woody said:
How would I set up a query to filter records based on time and date? I need
to run a report that I can specify a particular date and also the time of
that particular day to another particular date and time of day. Example, I
need to know how many gallons of fuel were pumped from a tank from 07:00 hrs.
on Sept. 9, 2005 to 13:12 hrs. on Sept16, 2005. I have used date to date
parameters many times, but not the combination of date and time. Is it even
possible with access?
Thanks
Woody

Woody,

The following expression, when used in a query, returns a valid
DATETIME value from two parameters:

CDate([FirstDate] & " " & [FirstTime])

It could be shortened to one parameter:

CDate([Date and Time])

If two of these expressions are dropped into the right spots in your
query, you get the range coverage you want.


Sincerely,

Chris O.
 
Woody said:
How would I set up a query to filter records based on time and date? I need
to run a report that I can specify a particular date and also the time of
that particular day to another particular date and time of day. Example, I
need to know how many gallons of fuel were pumped from a tank from 07:00 hrs.
on Sept. 9, 2005 to 13:12 hrs. on Sept16, 2005. I have used date to date
parameters many times, but not the combination of date and time. Is it even
possible with access?
Thanks
Woody

Woody,

The following expression, when used in a query, returns a valid
DATETIME value from two parameters:

CDate([FirstDate] & " " & [FirstTime])

It could be shortened to one parameter:

CDate([Date and Time])

If two of these expressions are dropped into the right spots in your
query, you get the range coverage you want.


Sincerely,

Chris O.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top