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 |
|
Niki
Yak Posting Veteran
51 Posts |
Posted - 2012-10-23 : 11:49:30
|
| Hi,I have phone number like "4 15556666". How can I replace the spaces or bad data in phone in my SELECT statement.Thank you,Niki |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2012-10-23 : 12:00:18
|
| SELECT REPLACE(PhoneNumber,' ','')FROM yourTableJimEveryday I learn something that somebody else already knew |
 |
|
|
Niki
Yak Posting Veteran
51 Posts |
Posted - 2012-10-23 : 12:12:17
|
| Thank you jimf. I had REPLACE(phone,'', '0') in stead of REPLACE(Phone,' ','0')Works like a charm :)Niki |
 |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2012-10-23 : 12:17:46
|
| You are welcome. And welcome to SQL Team!JimEveryday I learn something that somebody else already knew |
 |
|
|
|
|
|