Avatar of jnordeng

asked on 

Skip a letter in the alphabet in SQL query

Hi I was asked to come up with code to convert letters of the alphabet to months of the year which I did no problem. But then they  came back to me and said I needed to skip the letter "I"  in the process. I am stumped. If anyone can help I would sure appreciate it.

Data is 7115A12345. "A" is the month in this serial number that we want to convert to the month number but we need to skip "I" in the process

(ASCII(SUBSTRING(serial_number,5,1))- ASCII('A') + 1)  as [MONTH]
Microsoft SQL Server

Avatar of undefined
Last Comment
Rich Weissler

8/22/2022 - Mon