I have a task to find the next business day of particular given date. It should exclude the holidays that are listed in holiday table (mst_holiday
). I have a procedure using decode function to find the next business day when there is continuous holiday or weekend. For example if today is 21-07-2013 Wednesday, if I need to find 5 days later it should display 26-07-2013, if it is a holiday, it should display the successive non holiday.
The sample decode function I have used is below. Please help me to write alternate sql query.
DECODE
(ldate,
laps.holidaydate, DECODE
(ldate + 1,
laps.holidaydate + 1, DECODE
(ldate + 2,
laps.holidaydate + 2,ldate+3,ldate+2),ldate+1),ldate);`