SELECT paf.assignment_number
,ppf.full_name
,paygr.payroll_name
,paygr.payroll_id
,element_name
,pbt.balance_name
,ppa.effective_date
,prv.result_value
FROM pay_element_types_f pet
,pay_input_values_f piv
,pay_run_result_values prv
,pay_run_results prr
,pay_assignment_actions paa
,pay_payroll_actions ppa
,pay_balance_types pbt
,pay_balance_feeds_f pbff
,per_people_f ppf
,per_assignments_f paf
,per_grades gr
,pay_all_payrolls_f paygr
WHERE prr.element_type_id = pet.element_type_id
AND piv.element_type_id = pet.element_type_id
AND prv.input_value_id = piv.input_value_id
AND prv.run_result_id = prr.run_result_id
AND prr.assignment_action_id = paa.assignment_action_id
AND paa.payroll_action_id = ppa.payroll_action_id
AND pbff.balance_type_id = pbt.balance_type_id
AND piv.input_value_id = pbff.input_value_id
AND ppa.effective_date BETWEEN :P_FROM_DATE AND :P_TO_DATE
AND ppf.person_id = paf.person_id
AND SYSDATE BETWEEN ppf.effective_start_date
AND ppf.effective_end_date
AND paf.effective_start_date =
(SELECT MAX(effective_start_date)
FROM per_assignments_f paf1
WHERE paf.assignment_id = paf1.assignment_id)
AND paa.assignment_id = paf.assignment_id
AND gr.grade_id = paf.grade_id
AND paygr.payroll_id = paf.payroll_id
AND SYSDATE BETWEEN paygr.effective_start_date
AND paygr.effective_end_date
Nice. కీప్ అప్ గుడ్ work
ReplyDelete