Separation of Combination Data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I sometimes receive data that includes combination information that I need to
divide into separate columns, i.e. if I need to mail merge with first name
last name and the information in my database has the name all in one column.
How do I separate Mary Smith into two separate data fields?
 
Use the InStr function to find the location of the space in the name, then
use Left and Right functions to parse the name.

FirstName = Left(FullName, InStr(1, FullName, " ") - 1)
LastName = Right(FullName, Len(FullName) - InStr(1, FullName, " ") )

Assuming FullName is the name of the field with the names.
 

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

Back
Top