Pages

Thursday, September 30, 2004

Absence

select pay.payroll_name payroll_name,
org.name name,
per.employee_number employee_number,
per.first_name first_name,
per.last_name last_name,
abt.NAME Entry,
to_char(ab.date_start,'DD-MON-RRRR') start_date,
to_char(ab.date_end,'DD-MON-RRRR') end_date,
ab.absence_hours
from per_absence_attendances ab,
per_absence_attendance_types abt,
pay_payrolls_x pay,
per_assignments_f ass,
per_people_x per,
per_organization_units org
where org.organization_id = ass.organization_id
and pay.payroll_name = nvl(:p_payroll_name,pay.payroll_name )
and ass.payroll_id = pay.payroll_id
and ass.person_id = per.person_id
and ab.absence_attendance_type_id = abt.absence_attendance_type_id
and ab.person_id = per.person_id
and ab.date_notification between :p_start_date and :p_end_date
and ab.date_notification between ass.effective_start_date and ass.effective_end_date
and ass.primary_flag = 'Y'