Wednesday, February 15, 2017

Payroll Details Query

select pbt.balance_name, pet.element_name, piv.name input_value_name,piv.effective_start_date
from pay_balance_types pbt,
pay_balance_feeds_f pbf,
Pay_input_values_f piv,
pay_element_types_f pet
where pbt.balance_type_id = pbf.balance_type_id
and trunc(sysdate) between pbf.effective_start_date and pbf.effective_end_date
and piv.input_value_id = pbf.input_value_id
and pbf.effective_start_date between piv.effective_start_date and piv.effective_end_date
and pet.element_type_id = piv.element_type_id
and pet.effective_start_date between piv.effective_start_date and piv.effective_end_date
order by 1,2

select pbt.balance_name, pbd.dimension_name, pbd.description
from pay_defined_balances pdf,
pay_balance_types pbt,
pay_balance_dimensions pbd
where pdf.balance_type_id = pbt.balance_type_id
and pdf.balance_dimension_id = pbd.balance_dimension_id
order by 1,2