Altering data in column -

I have a column of data that I need to alter
the data format right  now is PenHg-001-42
I need to remove the penhg-001- and leave the numbers following the second -
TagomAsked:
Who is Participating?
 
Patrick MatthewsCommented:
To simply remove PenHg-001-:


UPDATE SomeTable
SET SomeColumn = Mid(SomeColumn, 11)
WHERE SomeColumn Like "PenHg-001-*"

Open in new window



To get everything after the second hyphen:


UPDATE SomeTable
SET SomeColumn = Mid(SomeColumn, InStr(InStr(1, SomeColumn, "-") + 1, SomeColumn, "-") + 1)
WHERE SomeColumn Like "*-*-*"

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.