Solved

Convert to money SQL

Posted on 2010-08-16
3
474 Views
Last Modified: 2012-05-10
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?
0
Comment
Question by:mattkovo
3 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 33449296
this should do
convert(money, replace(replace(sales, '(', ''), ')', '' )

Open in new window

0
 
LVL 16

Expert Comment

by:vdr1620
ID: 33449308
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,'(',''),'(',''))
0
 
LVL 9

Expert Comment

by:sureshbabukrish
ID: 33452768
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
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now