Question : Format string (numeric) to have commas

Is there a function in SQL Server to format a string (in numeric) to have commas for thousands, millions, billions, and so on ...

ex. '123456789'   - > '123,456,789'
    '34995.50'   - > '34,995.50'

Answer : Format string (numeric) to have commas

Try this

SELECT CONVERT(varchar(10),CAST(144847.15 AS MONEY),1)

This is an example for convert any numeric to chars
with commas separated.

First you have to cast it to money.
after that convert it using style as 1.

That all
Random Solutions  
 
programming4us programming4us