Another Query question

drsalvas

New Member
Joined
Oct 28, 2002
Messages
10
Please bear with my ignorace, I am new to the system.

On my table, I have a column with the format mm/dd/yyyy 00:00:00 PM.

I am querying on this column to find certain records, IE after a certain hour and I am using >#00:00:00 PM# format to get those records.

Now I need to be able to pull up all records BETWEEN times.

For example if I have records:
12/01/2002 12:00:00 PM
12/02/2002 01:00:00 PM
12/03/2002 01:15:00 PM

And I need to find all records for the month of December (all records in the table with be from that Month)between 12:00 PM and 2:00 PM, how would I setup that criteria in the query??

Thanks for your help.

Dan
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Hi Dan,

In the criteria part of one of your fields put something like this:

Month([dt1])="12" And Year([dt1])="2002" And Hour([dt1]) Between "12" and "14"

replace dt1 with the name of your date/time field.

So the Month is December (12) and the year is 2002 and the hour is between noon (12th hour) and 2pm (14th hour).

Make sense? You can put this in the criteria section for any field that's in your query.

Hope this helps - let us know if it does not,

Russell
 
Upvote 0

Forum statistics

Threads
1,221,490
Messages
6,160,133
Members
451,622
Latest member
xmrwnx89

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top