Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
yaman
Posting Yak Master
213 Posts |
Posted - 2010-01-20 : 09:35:41
|
| Hello sir ,I have Quantity coloumn need to covert 1234 into varchar with comma Need result = 123,4I am using this query .select ISNULL(CONVERT(varchar(100), 123456 ),1)Pls help me out Sir.Yaman |
|
|
shan
Yak Posting Veteran
84 Posts |
Posted - 2010-01-20 : 09:43:51
|
| You should be doing the data formatting in your front end application \ report.-Shan |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2010-01-20 : 13:16:44
|
| The only thing that I know that is capable of putting commas into string-numbers (but it will convert 1234 to "1,234" and not to "123,4") is CONVERT when converting from MONEY datatype to VARCHAR/CHAR.See SQL Server documentation for the CONVERT function. |
 |
|
|
divyaram
Posting Yak Master
180 Posts |
Posted - 2010-01-21 : 00:38:27
|
| select CONVERT(varchar(100),Quantity)as Quantity from'table name'Regards,Divya |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2010-01-21 : 01:54:32
|
| "select CONVERT(varchar(100),Quantity)as Quantityfrom'table name'"Useless. Doesn't do what the O/P asked for, and where do you get the idea from that converting a number needs 100 characters width? |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-01-25 : 03:18:10
|
quote: Originally posted by divyaram select CONVERT(varchar(100),Quantity)as Quantity from'table name'Regards,Divya
What will this return?MadhivananFailing to plan is Planning to fail |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-01-25 : 06:07:55
|
quote: Originally posted by yaman Hello sir ,I have Quantity coloumn need to covert 1234 into varchar with comma Need result = 123,4I am using this query .select ISNULL(CONVERT(varchar(100), 123456 ),1)Pls help me out Sir.Yaman
can i ask the need for this? |
 |
|
|
|
|
|
|
|