Link to home
Start Free TrialLog in
Avatar of mattkovo
mattkovo

asked on

Convert to money SQL

I have a value of ($6.53) that I need to convert to money.  The () is messing up the following syntax so I need to know how to work around it.

convert(money, sales)

Any help here?
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Well, i don't see any difference with and Without () .. but you think removing () will solve your problem use replace

SELECT CONVERT (MONEY,REPLACE(REPLACE(Sales,'(',''),'(',''))
select convert(money, ABS(sales))

probably the value ($6.53) is shown here should be a negative number and try using ABS function to negate it