Format numbers in money format with commas – SQL

Wanted to convert the number in money format with all commas and decimal, did not find very easily and clear  information in SQL BOL, so here it is:

convert the number to Money and then convert back to VarChar.

 select   CONVERT( varchar(16), cast (COUNT(*) as Money ), 1 )      from Table

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s