[dba-SQLServer] Formatting Numbers IN SQL

Elizabeth.J.Doering at wellsfargo.com Elizabeth.J.Doering at wellsfargo.com
Tue Sep 16 12:31:09 CDT 2008


Are you trying to stick the commas in?  'cause if you cast it as a
varchar 

	print '$' + cast(12345 as varchar)

you can append it to other varchars, but you don't get commas.  If you
find out how to do those, I would like to know too.

Thanks,


Liz   


 
 
This message may contain confidential and/or privileged information. If
you are not the addressee or authorized to receive this for the
addressee, you must not use, copy, disclose, or take any action based on
this message or any information herein. If you have received this
message in error, please advise the sender immediately by reply e-mail
and delete this message. Thank you for your cooperation.



-----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 12: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






More information about the dba-SQLServer mailing list