I want to separate a last anme first name at a comma

D

Dave

I have a db that I am importing. The Format is lastname,firstname. I want
to separate the name into 2 fields, lastname and first name at the comma.
How do I search for the comma and break the one filed into two?

Thanks

Dave K
 
C

Cheryl Fischer

You'll need to make use of the Left(), Mid() and InStr() functions in an
UpdateQuery. Here's how:

1. In the table containing the field with the full name in it, add two new
fields: LastName and FirstName

2. In an UpdateQuery, on the Update To: row for LastName, insert the
following:

Left([FullName], InStr([FullName], ",") - 1)

On the Update To: row for FirstName, insert the following:

Mid([FullName], InStr([FullName], ",") + 1)

hth,
 
D

Dave

Bless your heart!!

Thanks

Dave

Cheryl Fischer said:
You'll need to make use of the Left(), Mid() and InStr() functions in an
UpdateQuery. Here's how:

1. In the table containing the field with the full name in it, add two new
fields: LastName and FirstName

2. In an UpdateQuery, on the Update To: row for LastName, insert the
following:

Left([FullName], InStr([FullName], ",") - 1)

On the Update To: row for FirstName, insert the following:

Mid([FullName], InStr([FullName], ",") + 1)

hth,

--
Cheryl Fischer
Law/Sys Associates
Houston, TX

Dave said:
I have a db that I am importing. The Format is lastname,firstname. I want
to separate the name into 2 fields, lastname and first name at the comma.
How do I search for the comma and break the one filed into two?

Thanks

Dave K
 
C

Cheryl Fischer

You're welcome and good luck with your project.

--
Cheryl Fischer
Law/Sys Associates
Houston, TX

Dave said:
Bless your heart!!

Thanks

Dave

Cheryl Fischer said:
You'll need to make use of the Left(), Mid() and InStr() functions in an
UpdateQuery. Here's how:

1. In the table containing the field with the full name in it, add two new
fields: LastName and FirstName

2. In an UpdateQuery, on the Update To: row for LastName, insert the
following:

Left([FullName], InStr([FullName], ",") - 1)

On the Update To: row for FirstName, insert the following:

Mid([FullName], InStr([FullName], ",") + 1)

hth,

--
Cheryl Fischer
Law/Sys Associates
Houston, TX

Dave said:
I have a db that I am importing. The Format is lastname,firstname. I want
to separate the name into 2 fields, lastname and first name at the comma.
How do I search for the comma and break the one filed into two?

Thanks

Dave K
 

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