split data in 2 new fields

D

Dimitris

Hello,
I have a field called: FULLNAME in which first and last names are entered:
for example: JOHN LENNON (with a space between first and last name) Now I
have created two new fields: FNAME and LNAME and I need "JOHN" entered in the
field FNAME and "LENNON" entered in the field LNAME.

Can someone please help?
thank you.
Dimitris
 
R

RonaldoOneNil

Create a new query in the query design grid and put in the FNAME and LNAME
fields. Change it to an Update Query and then in the Update To row of your
FNAME column put

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

In Update To row of the LNAME column put

Mid([Fullname],InStr(1,[fullname]," ",1)+1)

Run the query. This will only work if there is always a space between
Firstname and Surname.
 
D

Dimitris

Thank you for your help.
It worked fine.


RonaldoOneNil said:
Create a new query in the query design grid and put in the FNAME and LNAME
fields. Change it to an Update Query and then in the Update To row of your
FNAME column put

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

In Update To row of the LNAME column put

Mid([Fullname],InStr(1,[fullname]," ",1)+1)

Run the query. This will only work if there is always a space between
Firstname and Surname.

Dimitris said:
Hello,
I have a field called: FULLNAME in which first and last names are
entered:
for example: JOHN LENNON (with a space between first and last name) Now I
have created two new fields: FNAME and LNAME and I need "JOHN" entered in
the
field FNAME and "LENNON" entered in the field LNAME.

Can someone please help?
thank you.
Dimitris
 

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