Time (Is not on my side)

tjs206

Registered User.
Local time
Today, 18:00
Joined
Sep 25, 2000
Messages
37
Problem: I have a user that wants to be able to select phone calls that were received during a certain time period (i.e. #10:00 PM# to #04:00 AM#). As you know, queries will not select the records between these times with a Between (StartTime) And (End Time) Statement, because it crosses midnight (#00:00 AM#).

Optimal Solution: I want the user to be able to put in a beginning time and ending time and have the query select all records between these times regardless if it crosses Midnight.

Any help would be greatly appreciated.

tjs206
 
Thanks for your help. I was trying to make a mountain out of a mole hill. Here is what I did in the criteria section of the query for the time field:

Between ([Forms]![frmSelections]![cmbStartTime]) And (#11:59:59 PM#) Or Between (#12:00:00 AM#) And ([Forms]![frmSelections]![cmbEndTime])

From there it was just defining which start and end times had midnight between the two ([Forms]![frmSelections]![cmbStartTime] > [Forms]![frmSelections]![cmbEndTime]). Then using if then statements to determine which query to utilize.

This works great. I thought it would be a programming nightmare, but it wasn't.

Thanks again for the suggestion.

tjs206

[This message has been edited by tjs206 (edited 11-07-2001).]
 

Users who are viewing this thread

Back
Top Bottom