Splitting a Field

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..............
 
J

Jerry Whittle

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.
 

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

Top