How can I parse last name from string

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

How can I parse the last name (Jones) from a string that might be Mr. and
Mrs. Bill Jones or Mr. Bill Jones or Bill Jones?
 
How can I parse the last name (Jones) from a string that might be Mr. and
Mrs. Bill Jones or Mr. Bill Jones or Bill Jones?

Depends on your version of Access. With 2003 (and perhaps 2002) you can use
the InStrRev (in string reverse) function to find the position of the last
blank:

Mid([Namefield], InStrRev([namefield], " ") + 1)

This will give incorrect results for names like "Hans van der Steen" or "Ramon
de Garcia", whose last names are van der Steen and de Garcia. Such names will
require a USB (Using Someone's Brain) interface.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top