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 next business working date in oracle with help of a function

User_HP4UTMar 11 2022 — edited Mar 16 2022

Hi.
I want to create a function to get the next business working day for the below scenario
1.Say 1st jan is saturday then my next business working day should be 3rd Jan.(Monday)
2. Also say if 14th April is Monday(Holiday) after my friday 11th April , next business day should be tuesday 15th april not 14th april.
My job should run only for business days. (Saturday and sunday not included)
i Need to create date function for this.
how do i get it?
Tried using next_day function but not working for scenario 2. please pour your thoughts

PS: I have an intermediate table which has all the holiday dates stored in it.
Below is the sample table
Holiday Date Next Business Date
01-JAN-2022 03-JAN-2022
17-FEB-2022 18-FEB-2022
18-MAR-2022 21-MAR-2022
15-APR-2022 18-APR-2022
Please help me create a function as i'm new to sql coding

This post has been answered by Frank Kulash on Mar 14 2022
Jump to Answer
Comments
Post Details
Added on Mar 11 2022
7 comments
869 views