Group, I need to remove the '-' from any negative numbers in a column for certain record numbers. However the Sum needs to * by .01 to get the correct format. I tried using replace but it is getting thrown off by the *.01 Below is my syntax.
CASE WHEN SUM(ExtPrice) *.01 < 0 AND RecordNum BETWEEN 4000 AND 5999
THEN REPLACE(SUM(ExtPrice) *.01,'-','')
ELSE SUM(ExtPrice) *.01
END AS Totals
For example SUM(ExtPrice) *.01
in one column gives me -5051.32 but when I use the above case statement I get 5050 another example -312.67 and I get 310 using the case. Any suggestions or better ways to do this are greatly appreciated.