Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Selecting time interval

655778Dec 4 2008 — edited Dec 4 2008
Hallo,

I have a DATE column and from this I need to select time intervals – precisely from 18:00 evening to next-day-morning 08:00 (that is from 18:00PM to 08:00AM).

I’m trying this:

SELECT DATE
FROM Table
WHERE TO_CHAR(DATE,’HH24:MI’) Between ‘08:00’ And ’18:00’

But I do not get the right records selected, it is as if I am unable to get past 00:00 mark into the next day.

Could anybody help me with this probably trivial problem?

Best regards from SQLNovice.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 1 2009
Added on Dec 4 2008
5 comments
453 views