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!

Identify if a period is between times which may span over midnight?

Phil RyanMay 26 2018 — edited May 29 2018

Hi

i have a database the has jobs that have a start_date and an end_date.

These are in the format dd/mm/yyyy hh:mm and could cover any period.

The business has time periods where these jobs are allowed to run outside of key business hours

For example between 18:00 to 08:00

I need to identify jobs that are within this period or are outside of this period.

i understand that I will have to identify anything the runs over the total allowed time to capture those that run over multiple days etc.

What I can’t achieve is the time testing elements as some run over midnight etc and I can’t produce a method that is 100%

correct.

Can anyone suggest a method?

Many thanks Phil

This post has been answered by mathguy on May 26 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 26 2018
Added on May 26 2018
15 comments
1,125 views