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 |
KingCarlos
Yak Posting Veteran
74 Posts |
Posted - 2014-07-15 : 02:20:19
|
I have some data in a field where the data can be 0001b0001a0001c0001dHow do I remove the 0001? |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2014-07-15 : 02:26:02
|
[code]replace(col, '0001', '')[/code] KH[spoiler]Time is always against us[/spoiler] |
|
|
KingCarlos
Yak Posting Veteran
74 Posts |
Posted - 2014-07-15 : 02:36:45
|
thanks for the reply but what if 0001 could be 0002 or 1234 what I need to know is how to remove the first 4 digits to leave the letter value |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2014-07-15 : 02:45:26
|
always the first 4 digits ?stuff(col, 1, 4, '') orright(col, len(col) - 4) KH[spoiler]Time is always against us[/spoiler] |
|
|
|
|
|