I have a case statement that is testing various conditions on a varchar column. The correct format for the data should start with two letters and be followed by eight numbers. Here is a piece of code from my case statement.
WHEN RIGHT(QRNumber, 8) NOT LIKE '%[0-9]%' THEN 'Validation Failure' Else Valid Quote Number
So QR123456AA is returning Valid Quote Number when it is not as the last two digits are non numeric characters.
I want to say if any of the last 8 characters are not numbers then the data is invalid.
Can anybody help me with the code I need?