Hi,
I need to parse last name,first name space middle name.
Example A - DOE,JOHN
Example B - DOE,JOHN A
I am able to parse the last name.
left(dbo.AbstractData.Name, charindex(',', dbo.AbstractData.Name)-1) as last name
I can parse the first and middle names together.
ltrim(right( dbo.AbstractData.Name,(len(dbo.AbstractData.Name)-charindex(',',dbo.AbstractData.Name))))
as firstmiddlename
I can parse the middle name.
SUBSTRING(dbo.AbstractData.Name,CHARINDEX(' ',dbo.AbstractData.Name + ' ')+1,LEN(dbo.AbstractData.Name))
I am having trouble parsing the first name. The first name is everything after the comma and before the first blank after the comma (or the end of the string, in which case there is no middle name).
Can anyone help me parse the first name only?
Thanks