I would like to be able to update a table variable in that if the third character is a 9 then I need to remove the last character.
This is what I am using currently:
SET Tag = (SELECT LEFT(Tag, LEN(Tag) - 1) WHERE SUBSTRING(Tag,3,1) = 9)
This has the correct effect on the rows where the character is 9, but the other rows where the third character is not 9 are updated to NULL.
Any help would be appreciated.