SQL to pull Position Costing Information

SQL to pull Position Costing Information

SQL to pull Position Costing Information

SELECT  to_char (pca.effective_start_date
                ,'RRRR-MM-DD') effective_start_date
       ,to_char (pca.effective_end_date
                ,'RRRR-MM-DD') effective_end_date
       ,pca.source_type costting_source
       ,p.name Position_Name
       ,p.position_code Position_Code
       ,PCAA1.source_sub_type costing_type
       ,PCAA1.proportion
       ,PCAA1.segment1
       ,PCAA1.segment2
       ,PCAA1.segment3
       ,PCAA1.segment4
       ,PCAA1.segment5
       ,PCAA1.segment6
       ,PCAA1.segment7
       ,(PCAA1.segment1
        || '-'
        || PCAA1.segment2
        || '-'
        || PCAA1.segment3
        || '-'
        || PCAA1.segment4
        || '-'
        || PCAA1.segment5
        || '-'
        || PCAA1.segment6
        || '-'
        || PCAA1.segment7) combined_value
FROM    pay_cost_allocations_f pca
       ,pay_cost_alloc_accounts PCAA1
       ,hr_all_positions_f_vl p
WHERE   pca.source_type = 'POS'
AND     pca.cost_allocation_record_id = PCAA1.cost_allocation_record_id
AND     pca.source_id = p.position_id
AND     pca.effective_start_date BETWEEN p.effective_start_date AND     p.effective_end_date

Leave a Reply

Your email address will not be published. Required fields are marked *