[dba-SQLServer]Convert Varchar(50) to Money

Djabarov, Robert Robert.Djabarov at usaa.com
Thu Nov 6 14:19:38 CST 2003


declare @value varchar(50)
set @value = '($29.92)'
select cast(replace(replace(@value, '(', '-'), ')', '') as money)

-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of
Nicholson, Karen
Sent: Thursday, November 06, 2003 11:14 AM
To: Dba-Sqlserver (E-mail)
Subject: [dba-SQLServer]Convert Varchar(50) to Money


I need to convert a field that is a varchar(50) to money.  The data
looks like this: $29.95 or ($29.95).

Any ideas?
_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com



More information about the dba-SQLServer mailing list