Procedure for the number of working days per month when the user enters to and from everyday

Hi all

Can provide you a solution to this - procedure for the number of working days per month when the user enters and days.

Suppose that the user enters November 18, 2014 start date and date as November 23, 2014.

The output should display

Count: 4

November 18, 2014 Mar

Sea 19 November 2014

November 20, 2014 game

Fri November 21, 2014

It will exclude Saturday and Sunday.

Hello

Here is an example of removing dates Saturday and Sunday:

with days as(
     select (trunc(sysdate, 'YEAR') + level) as col from dual
     connect by level < 365
)
select * from days
where trim(to_char(col, 'DAY', 'NLS_DATE_LANGUAGE=ENGLISH')) not in ('SATURDAY', 'SUNDAY')
      and col between to_date('18.11.2014', 'DD.MM.YYYY') and to_date('30.11.2014', 'DD.MM.YYYY')
order by col;

Cheerz,

Stako

Tags: Database

Similar Questions