By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,310 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,310 IT Pros & Developers. It's quick & easy.

Convert VARCHAR into Money Value

P: n/a
Ok i know this is simple but i just don't know the syntax. What I have
is a bunch of values and i want to be able to display them as money
values with a $ in front.

eg.

16000000
1000
160000

TO THIS

$16,000,000.00
$1000.00
$16,000.000
I'm using MS SQL 2000

Cheers

Mar 8 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
(Wo********@hotmail.com) writes:
Ok i know this is simple but i just don't know the syntax. What I have
is a bunch of values and i want to be able to display them as money
values with a $ in front.

16000000
1000
160000

TO THIS

$16,000,000.00
$1000.00
$16,000.000
I'm using MS SQL 2000


Normally, formatting should be done client-side. Not the least because
the format is dependent on regional settings. The above is not how I
want my decimal commas and thousands separator.

Nevertheless, you can do this:

declare @x money
select @x = 9009090909
select '$' + convert(varchar, @x, 1)


--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Mar 8 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.