I need to modify the following code so that if the original order type is = 'C' then it needs to multiply tot_sls_amt by -1 if orig_ord_type is anything else then just tot_sls_amt. My final result would show total sales grouped by year so that the credits are subtracted from the amount. SELECT TOP 100 PERCENT cus_no, SUM(tot_sls_amt) AS Expr1, LEFT(inv_dt, 4) AS [year]FROM dbo.OEHDRHST_SQLWHERE (orig_ord_type <> 'C')GROUP BY LEFT(inv_dt, 4), cus_noORDER BY cus_no