How to make two columns from one where first name and last name is separated by comma?

N

Ned Bec

Hi everybody,
I need to split field "NAME" which looks like Doe, John in two fields
"LastName" (Doe) and "FirstName" (John) in order to make new table with the
fields LastName and FirstName.
Please help.
Thank you in advance
Ned
 
G

Guest

Assuming all names are LN, FN -- try a make table query and split the name by
using instr() and left() and right() functions.

LastName: Left([name],InStr([name],",")-1)
FirstName: Right([name],Len([name])-InStr([name],",")-1)
 
J

John Vinson

Hi everybody,
I need to split field "NAME" which looks like Doe, John in two fields
"LastName" (Doe) and "FirstName" (John) in order to make new table with the
fields LastName and FirstName.
Please help.
Thank you in advance
Ned

Use the string handling functions to create calculated fields:

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

John W. Vinson[MVP]
 

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