Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 1st, 2004, 09:26 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 218
Thanks: 0
Thanked 0 Times in 0 Posts
Default Formatting Output

I want to output my numeric data in comma format. For example, 1000 would be 1,000.

Is there a native function in TSQL, or do I need to format in my programming code?

Thanks in advance.

- - - - - - - - - - - - - - - - - - - - - - -
In God we trust, everything else we test.
 
Old September 1st, 2004, 10:28 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Presentation issues should really be addressed at the front-end. SQLServer is a database engine, not a printing/formatting system and as such has very limited formatting capabilities. Also, from a deployment aspect, it's much simpler to have the front-end deal with any localisation issues e.g date styles than attempt to build the logic for it in SQL.

Chris


There are two secrets to success in this world:
1. Never tell everything you know
 
Old September 1st, 2004, 10:33 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 218
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I normally do this sort of thing on the front end as well, but I was hoping to to have the data returned "ready to go". No worries.

Thank you.

- - - - - - - - - - - - - - - - - - - - - - -
In God we trust, everything else we test.
 
Old September 1st, 2004, 10:35 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 218
Thanks: 0
Thanked 0 Times in 0 Posts
Default

P.S. - As for localization issues, the system involved is geographically intended for a single US state. In that regard, I have fewer issues to work out.

- - - - - - - - - - - - - - - - - - - - - - -
In God we trust, everything else we test.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Formatting Time Output braunj ASP.NET 2.0 Basics 0 October 6th, 2008 10:27 PM
Formatting Database Output Gobbles Classic ASP Basics 3 September 25th, 2007 05:08 AM
Output Formatting Neal XSLT 2 October 12th, 2006 05:12 AM
ASP to Excel - excel output formatting issue mat41 Classic ASP Professional 0 August 13th, 2006 06:41 AM
Formatting Ben Access 3 February 28th, 2004 05:52 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.