If your last names are all preceeded by a space, you can extract them using REVERSE, CHARINDEX, and SUBSTRING.
However, if you have compound last names that are not hyphenated, you're out of luck as far as reliable automated solution goes.
P
-----Original Message-----
From: Ellingson Cory (RCIS)
[mailto:mssqldba-ezmlmshield-x25383046.[Email address protected]
Sent: Thursday, February 24, 2005 11:44 AM
To: LazyDBA Discussion
Subject: Re-sort Name field
Hey all
I have a DB that has FULLNAME as a column...possible data could be as
follows...
FULLNAME
FirstName LastName
FirstName MiddleName LastName
FirstName NickName LastName
FirstName MiddleInital LastName
Now, I have a user that needs to see this sorted by last name so he can
x-ref a report he was given...
I have played with a few things; however, I am having difficulty finding the
last name so I can re-sort...Any help would be greatly appreciated.
Cory Ellingson
Production Services
---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
Website : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
For additional commands, e-mail: mssqldba-[Email address protected]
MS Sql Server LazyDBA home page