Usman Farooq
Usman Farooq

Reputation: 123

how to determine the weekend days in oracle table?

i am developing a payroll system using c# and oracle. I have AttendenceTable that keeps record of all the employee's attendance (on daily basis) and then i want to calculate the salary based on total number of days an employee worked. the problem is how can i calculate number of days except the weekends and then calculate salary? Please help me to sort out this problem

Upvotes: 0

Views: 61

Answers (1)

Bruno
Bruno

Reputation: 4655

With Oracle 11g, it is possible to determine if a date is a weekend this way, irrespectively of the NLS territory :

SELECT *
FROM mytable
WHERE TO_CHAR (my_date, 'DY', 'NLS_DATE_LANGUAGE=ENGLISH') IN ('SAT', 'SUN')

Upvotes: 2

Related Questions