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!

How to get midnight shift data

sanju2Apr 14 2014 — edited Apr 14 2014

Hi All,

I want to fetch data from a table that stores shifts. The query is able to fetch the data for all the shifts excepts for midnight that is falling between two days. like - 2300-0700 hrs or 2200-0600 hours. I am using UTC and I am using (start_tm<=to_char(SYS_EXTRACT_UTC(CURRENT_TIMESTAMP),'hh24mi')

                                                        and end_tm>=to_char(SYS_EXTRACT_UTC(CURRENT_TIMESTAMP) ,'hh24mi'))

here what other conditions I can use that would get me midnight too even if the data is pulled at around midnight. I have tried OR condition in addition with this and added 1 day to it but

it fails.

Regards,

This post has been answered by Solomon Yakobson on Apr 14 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 12 2014
Added on Apr 14 2014
6 comments
2,529 views