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
 how to select amt with thousand separator format?

Author  Topic 

amirmuthu
Starting Member

12 Posts

Posted - 2008-03-10 : 08:09:35
Hi,
Can you tell me the query for selecting the amount with thousand separator format?

for example : select 1234.678 is need to show the output line 1,234.68

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-03-10 : 08:10:59
can you perform the required formatting in your front end application ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

amirmuthu
Starting Member

12 Posts

Posted - 2008-03-10 : 08:16:52
sorry i need to be in 'select' query
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-03-10 : 08:19:56
[code]select convert(varchar(10), cast(1234.678 as money), 1)[/code]

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-03-10 : 08:36:13
quote:
Originally posted by amirmuthu

sorry i need to be in 'select' query



why ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

amirmuthu
Starting Member

12 Posts

Posted - 2008-03-10 : 08:47:06
quote:
Originally posted by harsh_athalye

select convert(varchar(10), cast(1234.678 as money), 1)


Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"



Thank you so much Harsh
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-03-10 : 09:55:28
It seems like this is for a report. If you're using SSRS or any other front end its really easier to do these formatting there. Try always to do them at your front end.
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2008-03-10 : 10:34:36
quote:
Originally posted by khtan

quote:
Originally posted by amirmuthu

sorry i need to be in 'select' query



why ?



Easy! Because they want to do things the hard way!

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page
   

- Advertisement -