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
 convert number in curreny number in sql2005

Author  Topic 

amirs
Constraint Violating Yak Guru

260 Posts

Posted - 2012-02-29 : 00:41:30
Dear Member

in my table on price field i won't to display this field in comma separate format to use select query like


Price
133333.00

i want to display following format

Price
1,33,333.00

so which function i have use in select query to display this format

i have use sql2005





webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2012-02-29 : 03:30:12
Whenever possible then do it in your front end. T-SQL isn't made for that.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-02-29 : 11:59:18
quote:
Originally posted by amirs

Dear Member

in my table on price field i won't to display this field in comma separate format to use select query like


Price
133333.00

i want to display following format

Price
1,33,333.00

so which function i have use in select query to display this format

i have use sql2005








where are you trying to show this?
which is your front end application/tool?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2012-02-29 : 12:33:29
[code]

DECLARE @m money; SET @m = 133333.00

SELECT CONVERT(varchar(25),@m,1)

[/code]


Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2012-02-29 : 12:39:43
hero


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2012-02-29 : 12:40:39
Now it's on to the Eastern Front

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2012-02-29 : 12:41:41
quote:
Originally posted by X002548

Now it's on to the Eastern Front

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/








No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2012-02-29 : 12:53:53
quote:

You fool! You fell victim to one of the classic blunders - The most famous of which is "never get involved in a land war in Asia" - but only slightly less well-known is this: "Never go against a Sicilian when death is on the line"!



Great Movie

http://www.imdb.com/title/tt0093779/

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page
   

- Advertisement -