Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Declare @Temp Table(Question VarChar(20))
Insert Into @Temp Values('1')
Insert Into @Temp Values('2a')
Insert Into @Temp Values('21b')
Select Case When PatIndex('%[^0-9]%', Question) > 0
Then Left(Question, PatIndex('%[^0-9]%', Question)-1)
Else Question
End As QuestionNumber,
Case When PatIndex('%[^0-9]%', Question) > 0
Then Right(Question, Len(Question) - PatIndex('%[^0-9]%', Question) + 1)
Else ''
End As QuestionOrder
From @Temp
SELECT
QuestionNumber,
Right(QuestionNumber,1) AS QuestionOrder,
Replace(QuestionNumber, Right(QuestionNumber,1), '') AS NewQuestionNumber,
FROM YourTable