I have a column which has FirstName and LastName together. I\'m writing a report to separate the FirstName And LastName. How do I get the FirstName and LastName separated in
The easiest way I can find to do it is:
SELECT SUBSTRING(FullName, 1, CHARINDEX(' ', FullName) - 1) AS FirstName, REVERSE(SUBSTRING(REVERSE(FullName), 1, CHARINDEX(' ', REVERSE(FullName)) - 1)) AS LastName FROM [PERSON_TABLE]