Listrite
asked on
Split a field based on first occuring space from left and . . .
Hi,
I have a field where I want to extract the all characters that are left of the first occurring space. But I also want to extract the characters if there is no space in the field.
So for example. I have created a field that I call, "FirstPart" In it I want information taken from a field called "First":
Field: First
Record 1: Jim K.
Record 2: Susan
When I run an update query to the FirstPart field; Left([First],InStr([First] ," ")-1)
I get:
Field: FirstPart
Record 1: Jim K.
Record 2: (blank)
I experimented with used Mid and Instrrev, but not getting any results. That would be due to my inexperience in using those functions.
Any thoughts?
Thanks,
Peter
I have a field where I want to extract the all characters that are left of the first occurring space. But I also want to extract the characters if there is no space in the field.
So for example. I have created a field that I call, "FirstPart" In it I want information taken from a field called "First":
Field: First
Record 1: Jim K.
Record 2: Susan
When I run an update query to the FirstPart field; Left([First],InStr([First]
I get:
Field: FirstPart
Record 1: Jim K.
Record 2: (blank)
I experimented with used Mid and Instrrev, but not getting any results. That would be due to my inexperience in using those functions.
Any thoughts?
Thanks,
Peter
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Jim and Capricorn,
Tried both solutions and they worked great. So with that in mind, couldn't really choose which to select as the "Best Solution"
boag2000: Thanks for your reply. The only requirement I had was to retrieve information in records that had information in the First field. So any nulls, blanks, did not matter in this case.
Peter
Tried both solutions and they worked great. So with that in mind, couldn't really choose which to select as the "Best Solution"
boag2000: Thanks for your reply. The only requirement I had was to retrieve information in records that had information in the First field. So any nulls, blanks, did not matter in this case.
Peter
What is there is no name? (blank, Null)
What if there is no space.
...etc