I have a field with names in the format DOE JOHN HOWARD or DOE JOHN H.
I need a query to get the string between the two spaces (JOHN in this case).
The SO an
One way:
select left(substring(fld, charindex(' ', fld) + 1, len(fld)), charindex(' ', substring(fld, charindex(' ', fld) + 2, len(fld))))