The Leave_transaction Table has the following Fields,
1.Leave_id
2.Emp_name
3.From_date
4.To_date
5.Remaining_days
The Emp_Master Table has the following columns,
1.Emp_id
2.Emp_Name
3.Remaining_days
Expand|Select|Wrap|Line Numbers
- select count(*) into days from (select dt
- from(
- select to_date(:p1_from_date, 'DD-Mon-YYYY') + rownum -1 dt
- from dual
- connect by level <= to_date(:p1_to_date, 'DD-Mon-YYYY') - to_date(:p1_from_date, 'DD-Mon-YYYY') + 1)
- where to_char(dt,'fmday') not in ('sunday','saturday') dual;
For example,
If the From_date is 04-may-2012'
and To_date is 08-may-2012,
Here the dates 5th may and 6th may are "saturday" and "sunday"
Then the remaining dates are(excluding sat,sunday and dates in holiday_table),
04-may-2012,
07-may-2012
08-may-2012.
so
Expand|Select|Wrap|Line Numbers
- count(*)
- 3
I think this
..where to_char(dt,'fmday') not in ('sunday','saturday')
code is not working.
Can anyone help me to solve my Issue.