[dba-SQLServer] Formatting Numbers IN SQL

David Emerson newsgrps at dalyn.co.nz
Tue Sep 16 16:41:49 CDT 2008


I tried that but still got "12345.00"

I am using SQL2000.

Regards

David

At 17/09/2008, you wrote:
>If you only want two decimal places you can use money, like this:
>
>select convert(varchar, convert(money, 12345) ,1)
>
>returns "12,345.00"
>
>-----Original Message-----
>From: dba-sqlserver-bounces at databaseadvisors.com
>[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of David
>Emerson
>Sent: Tuesday, September 16, 2008 1:20 PM
>To: dba-SQLServer at databaseadvisors.com
>Subject: [dba-SQLServer] Formatting Numbers IN SQL
>
>Since I didn't get a reply I will try another tact.
>
>There doesn't seem to be an SQL equivalent to the Access
>Format(12345,"#,##0").  What is the simplest way of taking a number
>like 12345.00 and converting it to a varchar "12,345"?
>
>
>Regards
>
>David Emerson
>Dalyn Software Ltd
>Wellington, New Zealand
>
>_______________________________________________
>dba-SQLServer mailing list
>dba-SQLServer at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
>http://www.databaseadvisors.com
>
>_______________________________________________
>dba-SQLServer mailing list
>dba-SQLServer at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
>http://www.databaseadvisors.com




More information about the dba-SQLServer mailing list