Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2005 > SQL Server 2005
|
SQL Server 2005 General discussion of SQL Server *2005* version only.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2005 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 October 16th, 2007, 12:53 AM
Friend of Wrox
 
Join Date: Apr 2005
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default Formatting string with comma

Hi All,

I have a table in SQL Server2005 with a salary field which contains data like:

datatype = text

Salary
------
$24000.00
$21,500.00
$8800.00
$23000.00
$15,900.00


I want all the datas to be uniform and be separated by ',' at the thousands place. Can anyone suggest me a SQL query or statement where I can do this.

Got really stuck ! Any help would be appreciated!!!
 
Old October 16th, 2007, 01:38 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 246
Thanks: 0
Thanked 0 Times in 0 Posts
Default

First alter your datatype to VARCHAR.







Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue in escaping comma from string in transforms joshuaa XSLT 5 August 20th, 2008 03:25 AM
Replace the string has comma with spaces? kumiko Classic ASP Basics 3 January 10th, 2008 06:41 PM
String Formatting sumith ASP.NET 2.0 Basics 1 October 3rd, 2007 07:35 AM
String formatting MargateFan XSLT 4 May 5th, 2006 04:54 AM





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