Hi!
I got syntex error message when try to run the code:
SELECT
CASE
WHEN NOT ISNUMERIC(LEFT(MRN,1)) THEN MRN
WHEN NOT ISNUMERIC(LEFT(RIGHT(MRN,2),1)) THEN RIGHT(MRN,2)
ELSE RIGHT(MRN,1)
END AS Code
FROM abo.tblPatients
The error message is: Incorrect syntax near the keyword "THEN" on the second line
Please tell me what's wrong?
Thanks in advance!
George
I got syntex error message when try to run the code:
SELECT
CASE
WHEN NOT ISNUMERIC(LEFT(MRN,1)) THEN MRN
WHEN NOT ISNUMERIC(LEFT(RIGHT(MRN,2),1)) THEN RIGHT(MRN,2)
ELSE RIGHT(MRN,1)
END AS Code
FROM abo.tblPatients
The error message is: Incorrect syntax near the keyword "THEN" on the second line
Please tell me what's wrong?
Thanks in advance!
George