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!

Count no of active days in a period for an employee

karthick.rajeSep 20 2019 — edited Oct 11 2019

Here is the employee table with start and end date of his assignments

PS_CTS_IQN_CWR_DTL
accrual_yearperiodemplidstart_dateend_date
201977873091-Jul-1931-Jul-19
201977873101-Jul-1931-Jul-19
201977873111-Jul-193-Jul-19
2019778731110-Jul-1931-Jul-19
201977874041-Jul-1923-Jul-19
201977874061-Jul-1931-Jul-19
201977874071-Jul-1928-Jul-19
2019778740729-Jul-1931-Jul-19

Here is the table with period end date

 

ps_CTS_IQN_PRD_TBL
periodyearperiod_end_date
720195-Jul-19
7201912-Jul-19
7201919-Jul-19
7201926-Jul-19
720192-Aug-19

need to count active days(only working days which should not include Saturday and Sunday) of each employee for each period for month of July (1st to 31st July). query should return us as given below

 

5-Jul-1912-Jul-1919-Jul-1926-Jul-192-Aug-19
78730955553
78731055553
78731133553
78740455553
78740655553
78740755553
This post has been answered by mathguy on Oct 4 2019
Jump to Answer
Comments
Post Details
Added on Sep 20 2019
15 comments
1,312 views