Break apart a Whole Name

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

Guest

I use A2003
===

I have a column or field named WholeName, e.g., Doe, John

How do I write an expression to break the WholeNames down into 2 columns:
LastName and FirstName, e.g., Doe and then John

Thank you
 
If you've always got the comma like that, then you can use the InStr, Left
and Mid functions:

FirstName: Mid([WholeName], InStr([WholeName], ",") + 1)
LastName: Left([WholeName], InStr([WholeName], ",") - 1)

You'd use the above as computed fields in a query: you shouldn't be storing
the information redundantly.
 
Thank you

Works beautifully

Will take heed of your admonition

Peace

Douglas J. Steele said:
If you've always got the comma like that, then you can use the InStr, Left
and Mid functions:

FirstName: Mid([WholeName], InStr([WholeName], ",") + 1)
LastName: Left([WholeName], InStr([WholeName], ",") - 1)

You'd use the above as computed fields in a query: you shouldn't be storing
the information redundantly.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Miles said:
I use A2003
===

I have a column or field named WholeName, e.g., Doe, John

How do I write an expression to break the WholeNames down into 2 columns:
LastName and FirstName, e.g., Doe and then John

Thank you
 

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

Similar Threads


Back
Top