Subject | Time between two times |
---|---|
Author | Lee Jenkins |
Post date | 2008-06-19T18:55:51Z |
Hi all,
I'm wondering what would be the best way to pull a record from the database
based on a StartTime and EndTime (both time fields) and a passed value of Time.
I know the BETWEEN command, but I'm wondering how it will be effected by the
way time is circular.
For instance, if the StartTime is 3:00 PM and the EndTime is 1:00 AM and the
current time is 5:00 PM, I don't think it will return the correct values since
it'll see the EndTime, 1:00 AM as part of the same day, but earlier.
I'm assuming the best way to handle will be within the application itself. My
first impulse is to build a flag into the app that the user can specify that the
end time value extends to the following day.
Thanks for suggestions,
--
Warm Regards,
Lee
I'm wondering what would be the best way to pull a record from the database
based on a StartTime and EndTime (both time fields) and a passed value of Time.
I know the BETWEEN command, but I'm wondering how it will be effected by the
way time is circular.
For instance, if the StartTime is 3:00 PM and the EndTime is 1:00 AM and the
current time is 5:00 PM, I don't think it will return the correct values since
it'll see the EndTime, 1:00 AM as part of the same day, but earlier.
I'm assuming the best way to handle will be within the application itself. My
first impulse is to build a flag into the app that the user can specify that the
end time value extends to the following day.
Thanks for suggestions,
--
Warm Regards,
Lee