Home » Applications » Oracle Fusion Apps & E-Business Suite » Query to fetch employee details and processed pay elements (Oracle HRMS/Payroll 11i)
Query to fetch employee details and processed pay elements [message #504631] |
Tue, 26 April 2011 23:48 |
|
guptasum
Messages: 14 Registered: March 2011
|
Junior Member |
|
|
Hello,
Below query (related to Oracle HRMS/Payroll) is used to pick up the employee details along with the payroll elements, processed on him/her that feed to a given balance (WORKCOVER) in the given date range (start_date and end_date).
However, it is picking up the elements processed (reduduncy comes into picture for the elements) in all the pay periods (start_date to end_date), and records are getting repeated with the same element names. Can someone help me in modifying this query to pick up the processed pay elements on the employee only once?
It would be great if someone can direct me in modifying the below query.
SELECT papf.per_information2 Pay_Tax_State
,papf.full_name Full_Name
,papf.employee_number Emp_Num
,paaf.assignment_id Asg_Id
,hla.location_code Location
,paf.payroll_name Payroll_Name
,haou.name Organization
,:l_end_date Effective_Date
,hapf.name Position_Name
,pj.name Job_Name
,ppos.date_start Original_Hire_Date
,ppos.actual_termination_date Actual_Termination_Date
,petf.element_name Element_Name
,paaf.normal_hours Normal_Hours
FROM per_all_people_f papf
,per_all_assignments_f paaf
,pay_all_payrolls_f paf
,hr_all_organization_units haou
,hr_locations_all hla
,hr_all_positions_f hapf
,per_jobs pj
,per_periods_of_service ppos
,pay_element_types_f petf
,pay_input_values_f pivf
,pay_balance_feeds_f pbf
,pay_balance_types pbt
,pay_payroll_actions ppa
,pay_assignment_actions paa
,pay_run_results prr
WHERE papf.person_id = paaf.person_id
AND paf.payroll_id = paaf.payroll_id
AND haou.organization_id = paaf.organization_id
AND hla.location_id = paaf.location_id
AND hapf.position_id = paaf.position_id
AND pj.job_id = paaf.job_id
AND ppos.person_id = papf.person_id
AND paaf.assignment_status_type_id = 1
AND pbf.balance_type_id = pbt.balance_type_id
AND pivf.input_value_id = pbf.input_value_id
AND petf.element_type_id = pivf.element_type_id
AND ppa.payroll_action_id = paa.payroll_action_id
AND paa.assignment_id = paaf.assignment_id
AND paa.assignment_action_id = prr.assignment_action_id
AND prr.element_type_id = petf.element_type_id
AND :l_end_date BETWEEN pbf.effective_start_date AND pbf.effective_end_date
AND :l_end_date BETWEEN pivf.effective_start_date AND pivf.effective_end_date
AND :l_end_date BETWEEN petf.effective_start_date AND petf.effective_end_date
AND pbt.balance_name = 'WORKCOVER'
AND ppa.action_type IN ('R','Q','B','V')
AND ppa.action_status = 'C'
AND ppa.effective_date BETWEEN :l_start_date AND :l_end_date
AND paf.payroll_id IN (81, 82)
AND :l_end_date BETWEEN paaf.effective_start_date AND paaf.effective_end_date
AND :l_end_date BETWEEN paf.effective_start_date AND paf.effective_end_date
AND :l_end_date BETWEEN papf.effective_start_date AND papf.effective_end_date
AND :l_end_date BETWEEN hapf.effective_start_date AND hapf.effective_end_date
AND papf.employee_number IN ('384062', '214734', '320095', '913871')
ORDER BY papf.employee_number
Kindly help me in modifying the query.
Thanks!
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Thu Nov 21 20:08:33 CST 2024
|