Query - Showing values if a certain time

jagstangman

Registered User.
Local time
Today, 22:51
Joined
Sep 28, 2005
Messages
20
Hello all, I am trying to dispay results in a query which is based upon time.

e.g.

Sample data - class and class start time

Class one - 7pm
Class two - 7pm
Class three - 7pm
Class Four - 8pm
Class Five - 8pm
Class Six - 9pm
Class Seven - 9pm
Class Eight - 9pm
Class Nine - 9pm

If i was using the sample data above and the time was between 7pm to 8pm i would like to show only the classes which started at 7pm, or if the time was 8pm to 9pm, only show the classes which started at 8pm and the same for 9pm

I hope i have explained myself clearly, and I will be thankful for any help.

Thanks
 
Is it a proper time field, if it is then use criteria Between Time() and Dateadd("N",-59,Time()).

Brian
 
Ah, thanks Brian. Worked perfectly! :-)
 
Good, glad you let me know, I was a bit worried that it was all one field :eek: , should have trusted you more. :)

Brian
 
Brian -

You beat me to it. Here's another possibility using the DateAdd() function to reduce current time to the starting hour, e.g.

? time()
8:14:16 AM
? dateadd("s", -(second(time())+ 60 * minute(time())), time())
8:00:00 AM

Bob
 

Users who are viewing this thread

Back
Top Bottom