I am having a column of Full name like:
Fullname
-----------------------
Joel (MD),Garris
Yong (MD),Park
Kristen (DO),Kenny
Jr, Jack (MD),Freimann
FirstName (title), LastName
What I actually want is FirstName only. I have tried following but cant get the result.
I tried using CHARINDEX and SUBSTRING but still dint find any result:
Replace(SUBSTRING(@aa,1,(CHARINDEX('(',@aa))),',','')
Tried to pull title seperately and then tried to replace it by null:
Replace(FullName,SUBSTRING(Fullname, CHARINDEX('(',Fullname,0),CHARINDEX(')',Fullname,CHARINDEX('(',Fullname,0))),'')
Can anyone tell me what is going wrong in this?