You can get the output you desire with grouping and some CASE statements inside SUM aggregate functions: SELECT dbo.TableB.TrackingID, dbo.TableA.ParcelCode, dbo.TableC.CustID, SUM(CASE WHEN dbo.TableB.FinanceType=”Invoice” THEN dbo.TableA.TotalAmount ELSE 0 END) AS TotalAmount, SUM(CASE WHEN dbo.TableB.FinanceType=”Invoice” AND TransType=”Card” THEN dbo.TableA.TotalAmount ELSE 0 END) AS CardInvoice, SUM(CASE WHEN dbo.TableB.FinanceType=”Invoice” AND TransType=”Cash” THEN dbo.TableA.TotalAmount ELSE 0 END) AS CashInvoice, … Read more