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 split a date range into months

Swaraj09Apr 7 2016 — edited Apr 11 2016

Hi,

I need to split a date range into months to calculate no of working days for each month using either SQL or PL/SQL code.

I have done it through hierarchy query but I am getting performance issue. Query is getting stuck.

Kindly help.

Sample data is as below:

Input records
Emp NameStart DtEnd Dt
swaraj15-Jan-201627-APR-2016
Output
Emp NameStart DtEnd Dt
swaraj15-Jan-201631-Jan-2016
swaraj01-Feb-201629-Feb-2016
swaraj01-MAR-201631-MAR-2016
swaraj01-APR-201627-APR-2016

Thanks,

Swaraj

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 9 2016
Added on Apr 7 2016
7 comments
4,115 views