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.
| Author |
Topic |
|
multiplex77
Starting Member
24 Posts |
Posted - 2007-10-21 : 04:40:49
|
| Hi,Is there a way in T-SQL for me to format the output of integers to include comma separators?e.g.,SELECT COUNT(TableID)FROM TableWithManyRowsI want the count to display as 50,000 instead of 50000. Is this possible? Thanks for the advice. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-10-21 : 05:10:39
|
can you do this in your front end application ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-10-21 : 05:15:54
|
It is better to do this in your front end application, unless if you absolutely, whatsoever, have to, must do it in T-SQL . . .select replace(convert(varchar(20), convert(money, 50000), 1), '.00', '') KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
multiplex77
Starting Member
24 Posts |
Posted - 2007-10-21 : 05:41:20
|
| Thanks KH that worked.Just curious, why is it better to do it in the front end? |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
multiplex77
Starting Member
24 Posts |
Posted - 2007-10-21 : 05:58:08
|
| Thanks KH. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-10-22 : 02:58:50
|
quote: Originally posted by multiplex77 Thanks KH that worked.Just curious, why is it better to do it in the front end?
If you use front end application, you should use format function thereMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|