In our SQL Server database we have money values that are negative. But I need to convert all negative values to positive values. I am using the following code in Query Analyzer:
--Convert all negative numbers to positive numbers
IF (SELECT field FROM table) < 0
SET field= (field * -1)
But I get the following error:
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
What am I doing wrong? Or is there a better way to get the absolute value of a negative number?
Thanks in advance.