Wednesday, 11 May 2016

Employee Payroll Name And Pay Bases

SELECT   ppt.user_person_type person_type, papf.full_name employee_name,
         papf.employee_number employee_number, pap.payroll_name, ppb.NAME pay,
         ppb.pay_basis
    FROM per_all_people_f papf,
         per_all_assignments_f paaf,
         per_person_types_tl ppt,
         per_pay_bases ppb,
         pay_all_payrolls_f pap
   WHERE papf.person_id = paaf.person_id
     AND paaf.primary_flag = 'Y'
     AND papf.current_employee_flag = 'Y'
     AND papf.business_group_id = paaf.business_group_id
     AND papf.person_type_id = ppt.person_type_id
     AND paaf.pay_basis_id = ppb.pay_basis_id
     -- AND PAPF.EMPLOYEE_NUMBER = '30987'
     AND paaf.payroll_id = pap.payroll_id
     AND TRUNC (SYSDATE) BETWEEN papf.effective_start_date
                             AND papf.effective_end_date
     AND TRUNC (SYSDATE) BETWEEN pap.effective_start_date
                             AND pap.effective_end_date
     AND TRUNC (SYSDATE) BETWEEN paaf.effective_start_date
                             AND paaf.effective_end_date
--   AND PAPF.FULL_NAME LIKE 'A%'
ORDER BY papf.full_name;

No comments:

Post a Comment