How to extract LastName, FirstName, MI? (Not all with MI). Sample
names:
John Doe
John M Doe
Thanks
|
|
0
|
|
|
|
Reply
|
Song
|
3/24/2010 1:33:09 PM |
|
Unfortunately, there's no simple answer. Sometimes the first name is two
parts and sometimes the last name is (Mary Lou Retton, Ludwig von
Beethoven). Sometimes there's only a first name. (Pele, Cher)
Realistically, you're likely going to USB (use someone's brain)
--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
(no e-mails, please!)
"Song" <song.usa@gmail.com> wrote in message
news:6a718e9d-9acd-49ec-ba5e-24baf0bb08d7@k36g2000prb.googlegroups.com...
> How to extract LastName, FirstName, MI? (Not all with MI). Sample
> names:
>
> John Doe
> John M Doe
>
> Thanks
|
|
0
|
|
|
|
Reply
|
Douglas
|
3/24/2010 1:53:10 PM
|
|
See:
http://allenbrowne.com/func-10.html
To get the first word from YourField, use:
ParseWord([YourField], 1)
To get the last word, use:
ParseWord([YourField], -1)
The middle name won't be as easy: Instr(), Mid(), and Len() may help.
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Song" <song.usa@gmail.com> wrote in message
news:6a718e9d-9acd-49ec-ba5e-24baf0bb08d7@k36g2000prb.googlegroups.com...
> How to extract LastName, FirstName, MI? (Not all with MI). Sample
> names:
>
> John Doe
> John M Doe
>
> Thanks
|
|
0
|
|
|
|
Reply
|
Allen
|
3/24/2010 1:58:29 PM
|
|
On 24.03.2010 14:33, Song wrote:
> How to extract LastName, FirstName, MI? (Not all with MI).
http://support.microsoft.com/kb/168799
Caveat: Every known way to parse a string into names is error prone.
http://stackoverflow.com/questions/103422/simple-way-to-parse-a-persons-name-into-its-component-parts
There are two basic problems:
1) You cannot rely on order. You have always a cause for distrust on
user input.
2) There are weird names out there in the wild. Especially there are
surnames consisting of two or more words only separated by spaces.
So in short: It's a NP-hard task... okay not really, you only need a
really large rainbow table with approximately 6 billion names. With
reduction it will be smaller than that but still large enough ;)
mfG
--> stefan <--
|
|
0
|
|
|
|
Reply
|
Stefan
|
3/24/2010 2:01:39 PM
|
|
As pointed out by others, not a simple task. And I'll add folks who add ",
Jr.", ", Senior", and ", III" to their names.
You can try using Left(), Right(), Mid(), and Instr() functions to start
with, then perform a final validation using someone's brain.
Good luck!
Regards
Jeff Boyce
Microsoft Access MVP
--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.
Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.
You can thank the FTC of the USA for making this disclaimer
possible/necessary.
"Song" <song.usa@gmail.com> wrote in message
news:6a718e9d-9acd-49ec-ba5e-24baf0bb08d7@k36g2000prb.googlegroups.com...
> How to extract LastName, FirstName, MI? (Not all with MI). Sample
> names:
>
> John Doe
> John M Doe
>
> Thanks
|
|
0
|
|
|
|
Reply
|
Jeff
|
3/24/2010 4:03:22 PM
|
|
|
4 Replies
272 Views
(page loaded in 0.082 seconds)
Similiar Articles: Parsing Names - microsoft.public.access.queriesI have a names field that has inconsistent data in it. Sometimes it has a FirstName and a LastName, and sometimes it also has a middle initial with or... Parse Name Field into First Name Last Name - microsoft.public ...I have a field called [Patient Name] that I want to parse out into a First Name Field and Last Name Field. I am using the Charindex() to find the com... parse name and address - microsoft.public.sqlserver.programming ...I have a SHIPTO field that includes name and address separated with carriage returns. Using CHARINDEX I tested for Char(13) and Char(10) and they ar... Parsing a network path - microsoft.public.accessHi, Gang, I am looking for help in parsing out a file name from a file path. I'm using the GetOpenFile api for users to choose the file path, whic... Parse field in query - microsoft.public.accessParsing Name Fields I am using the following statement in an update query (which by the way I found in this forum) to pull out the first name from the FirstName field. How to un-concatenate a field with full name - microsoft.public ...Parse Name Field into First Name Last Name - microsoft.public ... How to un-concatenate a field with full name - microsoft.public ..... and last name - is there a way to ... How do I combine "First Name", "Last Name" ...Parse Name Field into First Name Last Name - microsoft.public ... How do I combine "First Name", "Last Name" Fields into a "Name" Fi ... Parse Name Field into ... Split / Parse last word in a field - microsoft.public.access ...This doesn't address your specific data layout, but the code I posted here might ... Parse Name Field into First Name Last Name - microsoft.public ... Switch Last Name First Name to First Name Last Name - microsoft ...Parse Name Field into First Name Last Name - microsoft.public ... Switch Last Name First Name to First Name Last Name - microsoft ... Parse Name ... parse data from text field - microsoft.public.access.modulesdaovba ...I have changed some things in the database and I would like to parse just the file name and extension (ex. samplefile.doc). I have tried the Mid, Left, Right, and ... Name Parsing | Parse Names Determine Gender | Melissa DataDetermine Gender and Parse Names into five components: Prefix; First Name; Middle Name or Initial; Last Name; and Suffix. How To Parse a Person's Name into Multiple VariablesThis article provides a procedure for parsing a single variable containing a person's name into up to 6 parts: Title (Mr., Ms., etc.) First Name Middle ... Name Parsing - Welcome – Peacock Data, Inc.Name Parsing restructures database name information into a more useful format. FREE Name Parsing Software! - Welcome to Semaphore CorporationNAMECHOP parses single-field names into separate fields containing the individual parts of the names, like the following examples (punctuation retention is optional): PARSENAME (Transact-SQL)Returns the specified part of an object name. The parts of an object that can be retrieved are the object name, owner name, database name, and server name. 7/17/2012 7:37:33 PM
|