View Single Post

   
  #4 (permalink)  
Old 02-29-2008, 07:12 AM
Dan Guzman
 
Posts: n/a
Default Re: How do I format an integer

I agree with Simon that data formatting is best performed on in the
presentation layer rather than in SQL. That said, you can use CONVERT to
add commas and string functions to remove extraneous characters.

SELECT
REVERSE(SUBSTRING(REVERSE(CONVERT(varchar(20), CAST(1234565 AS money),
1)), 4, 20))

--
Hope this helps.

Dan Guzman
SQL Server MVP

"stevek" <someone@somewhere.org> wrote in message
news:IVxQd.220032$w62.163948@bgtnsc05-news.ops.worldnet.att.net...
> How do I format an integer. Add commas.
>
> 1234565 1,234,565
>
> TIA



Reply With Quote