SELECT DISTINCT papf.employee_number
,papf.full_name
,petf.element_name
,peef.effective_start_date
,pivf.name input_field
,peevf.screen_entry_value input_value
,peef.creation_date
,peef.last_update_date
FROM per_all_people_f papf,
per_all_assignments_f paaf,
pay_element_entries_f peef,
pay_element_types_f petf,
pay_element_entry_values_f peevf,
pay_input_values_f pivf
WHERE papf.person_id = paaf.person_id
AND papf.business_group_id = fnd_profile.value('PER_BUSINESS_GROUP_ID')
AND papf.current_employee_flag = 'Y'
AND paaf.assignment_id = peef.assignment_id
AND peef.element_type_id = petf.element_type_id
AND peef.element_entry_id = peevf.element_entry_id
AND TO_DATE (:p_date) BETWEEN peevf.effective_start_date AND peevf.effective_end_date
AND TRUNC (SYSDATE) BETWEEN papf.effective_start_date
AND papf.effective_end_date
AND TRUNC (SYSDATE) BETWEEN paaf.effective_start_date
AND paaf.effective_end_date
AND TO_DATE (:p_date) BETWEEN peef.effective_start_date AND peef.effective_end_date
AND TRUNC (SYSDATE) BETWEEN petf.effective_start_date
AND petf.effective_end_date
AND petf.element_type_id = pivf.element_type_id
AND peef.element_type_id = pivf.element_type_id
AND pivf.input_value_id = peevf.input_value_id
AND TRUNC (SYSDATE) BETWEEN pivf.effective_start_date
AND pivf.effective_end_date
--AND UPPER(pivf.name) IN ('AMOUNT', 'LOAN NUMBER', 'PERCENT')
--AND petf.element_name IN ('XX_ELEMENT_NAME1', 'XX_ELEMENT_NAME2', 'XX_ELEMENT_NAME3')
AND peevf.screen_entry_value IS NOT NULL
ORDER BY papf.employee_number
Keep posted.
ReplyDelete