Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Add $ symbol to column values

Author  Topic 

vignesht50
Yak Posting Veteran

82 Posts

Posted - 2014-02-12 : 23:38:43
Hi,

I want to add $ symbol to column values and convert the column values to western number system

Column values
Dollar
4255
25454
467834

Expected Output:
$ 4,255
$ 25,454
$ 467,834

My Query:
select ID, MAX(Date) Date, SUM(Cost) Dollars, MAX(Funded) Funding from Application

COST is the int datatype and needs to be changed.

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2014-02-13 : 01:18:34
If you are using SQL Server 2012, you can follow the below link
http://technet.microsoft.com/en-us/library/hh213505.aspx

--
Chandu
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2014-02-13 : 07:58:41
i would prefer doing this in front end as its a presentation issue. You do have functions like FORMAT() from SQL 2012 onwarsd but all such function would change base datatype to varchar which would be kind of overkill and cause issues if you use these values for further manipulations so I would not recommend them.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -