Anybody know how to do this?
I want to creat a SQL Query that SUMS an amout if a condition is positive or SUBTRACT The amout if it is NEGATIVE;
Something like this ( does not work)

SELECT *,SUM(QTD) AS QTT FROM FT GROUP BY REF

What i want is that QTD assumes the value QTD*-1 If a condition occurs , in my case IF CM > 50 (CM is an int number that is on the DB)

Thanks for any help