Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Between Time and Time error

Status
Not open for further replies.

bartus991

Instructor
Feb 11, 2009
44
NL
I have a table called tblTimePeriods which has the following data:
ID, Name, ReleaseTime, EndTime.

I need to retrieve data in a query within the selected time period. But, it wont be selected with the ID, but with a selected time. I was doing this with the Between ReleaseTime and EndTime criteria. It works fine, except when a period crosses midnight,

Period: 23:00 untill 03:00 hours
Selected time: 01:15
But in this case the Between function doesnt work correctly.
There are no dates in the table. Your help and solution would be appreciated.

Grtz Bartus991
 
A starting point:
Between ReleaseTime And Iif(EndTime>ReleaseTime, EndTime, EndTime+#24:00#)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top