2
Contributors
5
Replies
7
Views
5 Years
Discussion Span
Last Post by smantscheff
0

That depends on the actual format you're using. If you're not keeping track of the date, it's simply

select * from mytable where timefield <= '08:00' or timefield >= '20:00'

Edited by smantscheff: n/a

0

Ok. Maybe I have not come out clear here.
I have a list of data between diff. time periods (so, there's data between 00:00-08:00,08:00-15:00,20:00-08:00 .. so on and so forth).
I have an input field (say, 2012-01-25 21:00).
Now I wish to retrieve all data with a time window that includes 21:00.

The time periods are in two cols. [FROM_WINDOW;TO_WINDOW].

0

This is how my table is structured: -

ID        TIME_WINDOW_FROM       TIME_WINDOW_TO
ABC123    1899-12-30 20:00:00    1899-12-30 08:00:00
ABC456    1899-12-30 20:00:00    1899-12-30 08:00:00
ABC000    1899-12-30 08:00:00    1899-12-30 15:00:00

Now if my input is 2012-01-25 21:00, the result-set should return 2 rows.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.