469,126 Members | 1,296 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,126 developers. It's quick & easy.

How can you split data in 1 field (first and last name) into 2 fields (first, last)?

I have a field in my database with people's names. Each field has only one first name but may have more than one last name. The first name is always the first word in the field. I would like to split this field into two fields, first name and last name. Can I construct an action query to do that for me?
Feb 16 '11 #1
3 2194
Rabbit
12,516 Expert Mod 8TB
You can use InStr() to find the position of the first space and then use Mid() to retrieve the first or last name.
Feb 16 '11 #2
NeoPa
32,162 Expert Mod 16PB
That advice is absolutely correct, but as a point worth noting, names are always complicated due to their varying nature. If you have a specific rule about what goes where that is good, but be aware that such a simple rule is generally not going to cover your actual data reliably. This situation is a good example of why it's a good idea to store data elementally (See Database Normalisation and Table structures).
Feb 17 '11 #3
Worked perfectly. Thank you so much!
Feb 19 '11 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by gotcha | last post: by
3 posts views Thread by galsaba | last post: by
reply views Thread by Peter | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.