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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Separating Names in Query 1

Status
Not open for further replies.

kentwoodjean

Technical User
Oct 19, 2002
376
US
I have looked at several posts and Thread 701-794191 is most applicable to my situation. The only thing that is does not address is when you have a name formatted as:

O Donnell John.

I want a first name, Last Name, Mid Initial columna and then I will need to reverse the order of the current listing to a Proper Name column reading John ODonnell.

Your help is appreciated.
 
I don't think you are going to be able to find any algorithm that will handle all types of data entry variations. With your example there is no way to distinguish whether the 'O' is a middle initial or should be concatenated with 'Donnell'. If your data has any of the variations in format described in the other thread, then you are going to get stuck with some oddities.

The only way to be able to program string parsing effectively is to have the data consistent enough to be able to set up the rules and code to those rules. If you find that the only occurrences of O XXX are names like ODonnell and OBrien and there is never a case of an 'O' as a middle initial without a period, then you could possibly come up with code to handle it. But you also have to look for Mc and Mac things like that.

HTH
 
Thanks for your response. I will do a bit of reformatting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top