Monday, April 7, 2025

Query to extract Job Costing Information

 SELECT DISTINCT
    hik1.object_name "CostAllocationAccount",
    pca.segment2 "Segment2",
    pca.segment4 "Segment4",
    pca.proportion "Proportion",
    TO_CHAR(pc.effective_start_date,'DD-MON-YYYY') "EffectiveStartDate",
    TO_CHAR(pc.effective_end_date,'DD-MON-YYYY') "EffectiveEndDate",
    pc.source_type "SourceType",
    pj.job_code "JobCode",
    fs.set_code "SetCode",
    pca.source_sub_type "SourceSubType",
    pca.sub_type_sequence "SubTypeSequence",
    'GB Legislative Data Group' "LegislativeDataGroupName",
    hik1.source_system_owner "SourceSystemOwner",
    hik1.source_system_id "SourceSystemId"
FROM
    fusion.pay_cost_allocations_f pc,
    fusion.per_jobs_f pj,
    fusion.fnd_setid_sets fs,
    fusion.pay_cost_alloc_accounts pca,
    fusion.hrc_integration_key_map hik1
WHERE
    1 = 1
    AND   pc.source_type = 'JOB'
    AND   pc.source_id = pj.job_id
    AND   pj.set_id = fs.set_id
   -- AND   SYSDATE BETWEEN pj.effective_start_date AND pj.effective_end_date
    AND   pc.cost_allocation_record_id = pca.cost_allocation_record_id
    AND   pca.cost_alloc_account_id = hik1.surrogate_id
    AND   hik1.object_name = 'CostAllocationAccount'
Order By pj.job_code

No comments:

Post a Comment