SELECT per.employee_number,
per.full_name,
petf.element_name,
peevf.screen_entry_value
FROM pay_element_entries_f peef,
per_all_people_f per,
per_all_assignments_f paaf,
pay_element_types_f petf,
pay_element_entry_values_f peevf,
pay_input_values_f pivf
WHERE per.person_id = paaf.person_id AND paaf.primary_flag = 'Y'
-- AND paaf.assignment_type = 'E'
AND TO_DATE ('01-AUG-2013') BETWEEN peef.effective_start_date
AND peef.effective_end_date
AND TO_DATE ('01-AUG-2013') BETWEEN per.effective_start_date
AND per.effective_end_date
AND TO_DATE ('01-AUG-2013') BETWEEN paaf.effective_start_date
AND paaf.effective_end_date
AND TO_DATE ('01-AUG-2013') BETWEEN petf.effective_start_date
AND petf.effective_end_date
AND paaf.assignment_id = peef.assignment_id
AND UPPER (petf.element_name) =
'OPENING BALANCE
FOR ADVANCE COMMISSION'
AND peef.element_type_id = petf.element_type_id
AND peevf.element_entry_id = peef.element_entry_id
AND pay_paywsmee_pkg.processed (peef.element_entry_id,
peef.original_entry_id,
peef.element_type_id,
peef.entry_type,
peevf.effective_start_date) = 'N'
AND peevf.screen_entry_value > 0
AND pivf.element_type_id = petf.element_type_id
AND pivf.input_value_id = peevf.input_value_id
AND UPPER (pivf.name) = 'AMOUNT'
Very helpful !!!
ReplyDeleteRafee
THanks. Exactly the query i was looking for.
ReplyDeleteHi, Bijoy,
ReplyDeleteThis is very helpful to me, can u please help how to find the individual employee payroll element value like stranded Basic,
hii
ReplyDelete