Splitting a Field

  • Thread starter Thread starter GB
  • Start date Start date
G

GB

I am importing a table from excel in which my customers first and last names
appear in one field. I want to split this filed in access so I can sort and
search by first name and last name. Help..............
 
In a query:

FirstName: Left([Names],InStr(1,[Names]," ")-1)
LastName: Mid([Names],InStr(1,[Names]," ")+1)

Replace the [Names] with the proper field name.

The above statements assume that the first and last names are split at the
first space. Of course this still can cause problem such as "Mary Jane Smith"
and possibly "Jim von Lehman". Also you didn't mention anything about middle
initials.
 
Back
Top