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 |
|
rushdib
Yak Posting Veteran
93 Posts |
Posted - 2003-10-09 : 14:27:21
|
| Hi,In Access, I can use the following command to format numbers to stringsFormat(100.40, "00000") = "10040"Is there a equivalent function in Transact-SQL?Thanks,Rushdi |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2003-10-09 : 14:30:53
|
| Use CONVERT or CAST. You might need to use the REPLACE function as well to remove the period.Something like this:CONVERT(VARCHAR(50), REPLACE(SomeColumn, '.', ''))Tara |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2003-10-09 : 14:32:56
|
| [code]DECLARE @x decimal(6,2)SELECT @x = 100.40SELECT @x, REPLACE(CONVERT(varchar(10),@x),'.','')[/code]Brett8-) |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2003-10-09 : 14:38:40
|
| 2 solutions that both work!Tara |
 |
|
|
|
|
|