Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

T SQL - Name Format - String manipulation

Status
Not open for further replies.

Molkas

Technical User
Jun 2, 2004
15
0
0
US
Hello everybody,

I'm new to MS T SQL. I'd like to request your help with name formatting. My data comes from one single table and contains employee names like this:

ANDREW J. O'BRIEN JR.
I need to format the names as follows:

O'Brien, Jr. Andrew J

Thank you in advance for your assistance.

Ralph.


 
I doubt all of your names are in that format. Can you give us a sample of the different ways names appear?

For example, do they all have a middle initial? Do some have a middle name instead, or no initial?

BTW-this question has been asked/answered a few times on this site. You might try doing a search along with posting the information I requested.

-SQLBill

Posting advice: FAQ481-4875
 
Thank you for responding so quickly to my post SQLBill. You're absolutely correct. Most of the names in my table actually contain just first name and last name. However there are some names with Jr. and II/III suffixes. The typical data in my table will be:

Andrew O'Brien. I need the data to be formatted: O'Brien, Andrew

Thank you once again for your assistance.
Ralph.
 
Check out this THREAD183-1224679.

-SQLBill

Posting advice: FAQ481-4875
 
Sorry I couldn't reply sooner. Thank you very much for the tip. Ralph
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top