Name field needs seperated!!

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

Guest

I have a database field that is currently like this: Carter, David E
I need to put them into seperate columns for a First Middle Last. Can this
be done?
 
I have a database field that is currently like this: Carter, David E
I need to put them into seperate columns for a First Middle Last. Can this
be done?

[Lastname] = Left([FullName],InStr([FullName],",")-1)

Then, if there is a space after the comma:
[RestOfName] = Mid([FullName],InStr([FullName],",")+2)

If there is no space after the comma:
[RestOfName] = Mid([FullName],InStr([FullName],",")+1)
 
For the second name you can use that, no metter if there is space

[RestOfName] = trim(Mid([FullName],InStr([FullName],",")+1))

--
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benefit from it.

Good luck



fredg said:
I have a database field that is currently like this: Carter, David E
I need to put them into seperate columns for a First Middle Last. Can this
be done?

[Lastname] = Left([FullName],InStr([FullName],",")-1)

Then, if there is a space after the comma:
[RestOfName] = Mid([FullName],InStr([FullName],",")+2)

If there is no space after the comma:
[RestOfName] = Mid([FullName],InStr([FullName],",")+1)
 
Back
Top