Vinit Patel

Add Currency Symbol to the database value in Sql Server

Posted by: Vinit on: June 3, 2011

Hi,

If you have the Data in Sql table like

Value

15

17

 

Now, If you want to print the values like $15 and $17. So you will have to do like this…

SELECT LEFT(‘$’ + CONVERT(VARCHAR, CAST(’15.00′ AS MONEY), 1), LEN(‘$’+ CONVERT(VARCHAR, CAST(’15.00′ AS MONEY), 1)) – 3)

Advertisement
Tags: ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Calendar

June 2011
M T W T F S S
« Apr   Jan »
 12345
6789101112
13141516171819
20212223242526
27282930  

Stats Of Blog

  • 1,945 hits

Cluster Map

Follow

Get every new post delivered to your Inbox.