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 |
|
esthera
Master Smack Fu Yak Hacker
1410 Posts |
Posted - 2007-03-27 : 02:27:34
|
| how can i do the following in sqlif left(destination,1)="0" thenif cint(mid(destination,2,1))>1 thendestination="0044" & mid(destination,2,ldestination-1)end ifend if |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-03-27 : 02:28:36
|
| SUBSTRING(Destionation, 2, 1)Peter LarssonHelsingborg, Sweden |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-03-27 : 02:30:02
|
| But you should really useIF @Destination LIKE '0[2-9]%' SET @Destination = '0044' + SUBSTRING(@Destination, 2, 8000)Peter LarssonHelsingborg, Sweden |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-03-27 : 02:31:04
|
| OrUPDATE Table1SET Destination = '0044' + SUBSTRING(Destination, 2, 8000)WHERE Destination LIKE '0[2-9]%'Peter LarssonHelsingborg, Sweden |
 |
|
|
|
|
|