split data in 2 new fields

  • Thread starter Thread starter Dimitris
  • Start date Start date
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
 
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.
 
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
 
Back
Top