Left() and Right() Function

D

Dan

I have 3 fields in my query
[FirstName]
[LastName]
[FullName]

I would like to update the [FirstName] field with the first name listed in
the [FullName] Field. and update the [LastName] field with the last name
listed in the [FullName] Field.

I was thinking on something like this:
Update [FirstName] = Right([FullName], )
Update [LastName] = Left([FullName],)

The problem I have is I don't know how to make the Right() and Left()
functions look for a space
 
K

Ken Snell

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

LastName: Mid([FullName], InStr([FullName], " ") + 1)
 
D

Dan

Thank You, That worked great. I thought that I would be retyping over 5000
names tonight
Now I just have to edit a few where there was a middle initial between the
first and last name.

Ken Snell said:
FirstName: Left([FullName], InStr([FullName], " ") - 1)

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

--
Ken Snell
<MS ACCESS MVP>

Dan said:
I have 3 fields in my query
[FirstName]
[LastName]
[FullName]

I would like to update the [FirstName] field with the first name listed in
the [FullName] Field. and update the [LastName] field with the last name
listed in the [FullName] Field.

I was thinking on something like this:
Update [FirstName] = Right([FullName], )
Update [LastName] = Left([FullName],)

The problem I have is I don't know how to make the Right() and Left()
functions look for a space
 

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