| Author |
Topic |
|
JJ297
Aged Yak Warrior
940 Posts |
Posted - 2010-03-10 : 09:51:25
|
| I have a customer number and would like to remove the -(dashes) in the record.The field is called F1Here's a row of data2569-6589-22How do I do this in sql 2005? |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-03-10 : 09:54:39
|
| Select replace(F1,'-','') from your_tableMadhivananFailing to plan is Planning to fail |
 |
|
|
haroon2k9
Constraint Violating Yak Guru
328 Posts |
Posted - 2010-03-10 : 09:54:55
|
quote: Originally posted by JJ297 I have a customer number and would like to remove the -(dashes) in the record.The field is called F1Here's a row of data2569-6589-22How do I do this in sql 2005?
Could you please checkSELECT '2569-6589-22'SELECT REPLACE('2569-6589-22','-','') |
 |
|
|
haroon2k9
Constraint Violating Yak Guru
328 Posts |
Posted - 2010-03-10 : 10:03:01
|
Oh!.my god..Just 16 sec Mr.Madhi..Any how i Can't Beat you.. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-03-10 : 10:05:11
|
quote: Originally posted by haroon2k9 Oh!.my god..Just 16 sec Mr.Madhi..Any how i Can't Beat you..
You need to type fast MadhivananFailing to plan is Planning to fail |
 |
|
|
haroon2k9
Constraint Violating Yak Guru
328 Posts |
Posted - 2010-03-10 : 10:07:05
|
quote: Originally posted by madhivanan
quote: Originally posted by haroon2k9 Oh!.my god..Just 16 sec Mr.Madhi..Any how i Can't Beat you..
You need to type fast MadhivananFailing to plan is Planning to fail
Lol!!!! |
 |
|
|
JJ297
Aged Yak Warrior
940 Posts |
Posted - 2010-03-10 : 10:11:17
|
Thanks that worked but I have other fields in the table how do I just replace that field F1 and not wipe out the others, F2, F3, and F4? Don't worry this was a test table. |
 |
|
|
haroon2k9
Constraint Violating Yak Guru
328 Posts |
Posted - 2010-03-10 : 10:13:01
|
quote: Originally posted by JJ297 Thanks that worked but I have other fields in the table how do I just replace that field F1 and not wipe out the others, F2, F3, and F4? Don't worry this was a test table. 
Sorry i wasn't getting you |
 |
|
|
JJ297
Aged Yak Warrior
940 Posts |
Posted - 2010-03-10 : 10:15:30
|
| When I ran this:Select replace(F1,'-','') from your_tableit worked but I just had the one column on the screen. When I opened the table it didn't make any changes. So I see it makes a new column that's fine but how do I put that into my same table? |
 |
|
|
haroon2k9
Constraint Violating Yak Guru
328 Posts |
Posted - 2010-03-10 : 10:19:15
|
quote: Originally posted by JJ297 When I ran this:Select replace(F1,'-','') from your_tableit worked but I just had the one column on the screen. When I opened the table it didn't make any changes. So I see it makes a new column that's fine but how do I put that into my same table?
Do you mean by Updating the Original Table.Just UpdateUpdate tset col=replace(F1,'-','')from tbl t |
 |
|
|
JJ297
Aged Yak Warrior
940 Posts |
Posted - 2010-03-10 : 10:25:59
|
Yes that's it!!! Thanks so much. So happy you guys are racing one another to answer our questions. This way we don't wait too long for an answer! |
 |
|
|
haroon2k9
Constraint Violating Yak Guru
328 Posts |
Posted - 2010-03-10 : 10:30:06
|
quote: Originally posted by JJ297 Yes that's it!!! Thanks so much. So happy you guys are racing one another to answer our questions. This way we don't wait too long for an answer!
you are please welcome |
 |
|
|
|