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
Assuming the FirstName is all of the characters up to the first space:
FirstName
SELECT SUBSTRING(username, 1, CHARINDEX(' ', username) - 1) AS FirstName, SUBSTRING(username, CHARINDEX(' ', username) + 1, LEN(username)) AS LastName FROM whereever