I have a field 'FirstName' that is 9 characters long. Some firstnames take all 9 characters and some do not take all the characters and have the middle initial. I want to strip the middle inital where it exist and where it does not exist skip and move on to the next.
I used the folowing to strip the middle inital which seemed to work initally, but names with no space I get the whole firstname.
select substring(BS.FIRSTNAME,charindex(' ',BS.FIRSTNAME)+1,len(BS.FIRSTNAME)) as [MI]
from BLUESHIELD BS
I used the folowing to strip the middle inital which seemed to work initally, but names with no space I get the whole firstname.
select substring(BS.FIRSTNAME,charindex(' ',BS.FIRSTNAME)+1,len(BS.FIRSTNAME)) as [MI]
from BLUESHIELD BS