hi, using a sql script to calc a margin as a %..
so its something like:
((TotalMargin + TotalRefundedMargin) / nullif((TotalNetSales+ TotalRefundedSales),0)) * 100 AS [Margin%],
however, the problem occurs when TotalNetSales+ TotalRefundedSales < 0 and TotalMargin + TotalRefundedMargin < 0..
how can i do a check to see if both these figures are less than 0...set Margin% as 0 (zero)?