Michael Jaynes Michael Jaynes - 1 year ago 89
SQL Question

Add a negative symbol to a numeric value

Using SQL 2014 I need to append a negative sign to a list of numeric values. The data are dollar amounts with numerous places behind the decimal point. I did convert the data to numeric(15, 2)

Here is my select statement.

SELECT '-' + convert(15,2), MONEY from TABLE

I am getting the error: Arithmetic overflow error converting varchar to data type numeric.

I tried converting to varchar as well.

select '-' + CONVERT(varchar10), (convert(numeric(15, 2), MONEY)) from

I get the same error as above. Any ideas how to accomplish this?

Answer Source
SELECT -convert(MONEY, 15.2) from TABLE
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download