• I think this is what you are looking for.

    SELECT

    p.country_code,

    p.local_client_code,

    wwc.local_client_name,

    sum(case when pr.fiscal_year = 2015 then pr.local_consulting_fees*er.rate + pr.local_product_fees * er.rate + pr.local_admin_fees * er.rate + pr.local_misc_fees * er.rate else 0 end) as '2015 Revenue',

    sum(case when pr.fiscal_year = 2014 then pr.local_consulting_fees*er.rate + pr.local_product_fees * er.rate + pr.local_admin_fees * er.rate + pr.local_misc_fees * er.rate else 0 end) as '2014 Revenue',

    sum(case when pr.fiscal_year = 2013 then pr.local_consulting_fees*er.rate + pr.local_product_fees * er.rate + pr.local_admin_fees * er.rate + pr.local_misc_fees * er.rate else 0 end) as '2013 Revenue'

    FROM dbo.tblProject p

    JOIN dbo.tblProject_Revenue pr ON p.project_number = pr.project_number and p.country_code = pr.country_code and p.fiscal_year = pr.fiscal_year

    JOIN dbo.tblExchange_Rates er ON pr.rept_currency_code = er.currency_code AND er.fiscal_year = pr.fiscal_year AND er.rate_type = 'BUD'

    JOIN dbo.tblWorldWide_Clients wwc ON p.local_client_code = wwc.local_client_code AND p.country_code = wwc.country_code

    JOIN dbo.tblHayGroup_Organization ho ON p.unit_id = ho.unit_code AND ho.automated_status = 'Y' OR ho.country_code IN ('JPN','CHN')

    GROUP BY p.country_code,p.local_client_code,wwc.local_client_name

    The issue was that you had switched the scope of the CASE and SUM expressions. You had the SUM inside of the CASE when you needed the CASE inside of the SUM. You most likely did this, because you overlooked the fact that SUM is essentially addition and addition is associative. So that SUM(X) + SUM(Y) = SUM(X+Y)--as long as you account for null values appropriately.

    Also, you most definitely DO NOT want the fiscal year in your GROUP BY if you want all of the fiscal years to appear on the same row.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA