• Based on your original code and if you only ever have parts and labor then the below should work.

    Not tested due to not having the DDL of the tables and sample data but the general idea is there for you to tweak.

    DECLARE @StartDate DATETIME

    DECLARE @EndDate DATETIME

    SET @StartDate = '1/1/2012'

    SET @EndDate = '1/31/2012'

    SELECT B.EngEquipID

    ,B.Location

    ,B.Cycles

    ,B.DateTimeStamp

    ,'Labor' AS Labour

    ,CASE WHEN B.Source = 'Labor' THEN SUM(B.TRANS_tambase_amt) END as [Labor Total Amount]

    ,'Parts' AS Parts

    ,CASE WHEN B.Source = 'Parts' THEN SUM(B.TRANS_tambase_amt) END as [Parts Total Amount]

    FROM (

    SELECT ER.EngEquipID

    ,ER.Location

    ,ER.Cycles

    ,ER.DateTimeStamp

    ,A.Source

    ,A.TRANS_tambase_amt

    FROM Engine_Prod.mc.WORKORDER WO

    LEFT OUTER JOIN MSM.dbo.tblEngRunData ER ON ER.WONumber = ltrim(rtrim(WO.id))

    LEFT OUTER JOIN mc.WORKTASK WT ON WO.wordoi = WT.wrkord_oi

    LEFT OUTER JOIN mc.WORKORDERTYPE WOT ON WO.wot_oi = WOT.wotyoi

    LEFT OUTER JOIN (

    SELECT 'Labor' Source

    ,CHARGEINF.wt_oi

    ,LABORTRANS.tambase_amt TRANS_tambase_amt

    FROM mc.CHARGEINF CHARGEINF

    INNER JOIN mc.lbtr_chgs lbtr_chgs ON CHARGEINF.chgioi = lbtr_chgs.ref_oi

    INNER JOIN mc.LABORTRANS LABORTRANS ON lbtr_chgs.owner_oi = LABORTRANS.lbtroi

    WHERE LABORTRANS.posted = 1

    UNION ALL

    SELECT 'Parts' Source

    ,CHARGEINF.wt_oi

    ,INVTRANS.tambase_amt TRANS_tambase_amt

    FROM mc.CHARGEINF CHARGEINF

    INNER JOIN mc.intr_chgs intr_chgs ON CHARGEINF.chgioi = intr_chgs.ref_oi

    INNER JOIN mc.INVTRANS INVTRANS ON intr_chgs.owner_oi = INVTRANS.introi

    WHERE INVTRANS.posted = 1

    ) A ON WT.wtskoi = A.wt_oi

    WHERE ER.DateTimeStamp BETWEEN @StartDate

    AND @EndDate

    AND WO.clsdt_date BETWEEN @StartDate

    AND @EndDate

    AND WT.ci_cnc_date IS NULL

    AND WT.tmplt = 0

    AND A.Source is not null

    GROUP BY ER.EngEquipID

    ,ER.Location

    ,ER.Cycles

    ,ER.DateTimeStamp

    ,A.Source

    ,A.TRANS_tambase_amt

    ) B

    GROUP BY B.EngEquipID

    ,B.Location

    ,B.Cycles

    ,B.DateTimeStamp

    --,B.Source