format a numeric values with commas

From: hari (anonymous_at_discussions.microsoft.com)
Date: 09/23/04


Date: Thu, 23 Sep 2004 02:24:33 -0700

hi Steve,
  Thanks for that. it is working fine.
 But for the whole numbers like 123456 it is not doing so.
 it is formatting to 1,234,567.00 (with two zeroes after
 decimal). i want it to be formatted as 1,234,567

 how to format 1234567 to 1,234,567

thanks,
hari.

>-----Original Message-----
>declare @list_price numeric(20,6)
>set @list_price = 1221512.34
>
>select
> convert(varchar(100),cast(@list_price as money),1)
>
>Steve Kass
>Drew University
>
>hari wrote:
>
>>hi,
>> I have requirement.
>> I want to format a numeric value with commas. is there
>>any function to use in transact-sql query to do this.
>>for example if the numeric value is 27519.37 then it
>>should be formatted as 27,519.37
>> if the numeric value is 1221512.34 then it should be
>>formatted as 1,221,512.34
>>
>>regards,
>>hari.
>>
>>
>>
>>
>.
>
.



Relevant Pages

  • Re: Error in Date field format and calculation
    ... in the DTPicker with the days value in the 'hari' field.For example ... 'Start date' with the days value in the 'peruntukan' field.For example ... The format of the date in the database field is completely meaningless and all that code is doing is giving VB a chance to mess it up. ... Private Sub Form_Load ...
    (microsoft.public.vb.database)
  • Re: US and Indian Date conflict
    ... Date format this cell as desired. ... "Hari" wrote in message ... | those records I have to interchange the month and date value. ... | Is there a way to do this using formula or macro (what would be the logic ...
    (microsoft.public.excel.programming)
  • Re: Changing Default Date format in excel
    ... Since changing the short date style doesn't work, you could format the ... Hari wrote: ... Debra Dalgleish ...
    (microsoft.public.excel.misc)
  • Re: FORMAT
    ... Hari ... SQL Server MVP ... I have a query that goes like: ... I know there is a FORMAT function in access, ...
    (microsoft.public.sqlserver.msde)
  • Re: Calculating Date difference in 2 ways
    ... Just format the formula cell ... Hari wrote: ... > Why is there a diference in formatting of results between the above 2 ...
    (microsoft.public.excel.misc)