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!

Script to retrieve previous month business day

Dinesh AtluriAug 17 2016 — edited Aug 17 2016

Hello Gurus,

I am looking for a sql script which fetches previous month last business day (Please note we are considering Saturday also as a business day).

Currently I am using the below script to get the previous month last day.

SELECT LAST_DAY(ADD_MONTHS(TO_DATE(SUBSTR(20160817081900,1,8),'YYYYMMDD'),-1)) AS PREV_MONTH_LAST_BUSI_DAY

FROM DUAL;

In this case,my script returns 31-JUL-16 as the output but I need the output as 30-JUL-16.

Please advise.

Regards,

Dinesh.

This post has been answered by Boobal Ganesan on Aug 17 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 14 2016
Added on Aug 17 2016
4 comments
388 views