display part of a text string

M

Mark McCoy

I have a field called CONTACT that has both a name and phone number as
text.

I need to separate this into two fields, NAME and PHONE. How do I
display just the name? Since the string is of variable length, how do
I define the length as a variable.

I can pull the phone number out with Right(contact,12) since it is
always ten characters long. But how do I treat the name since I never
know how long the name will be or how it will be formatted.

Examples:

Steve Jones 908-555-1211
Brenda A Smith 704-222-8899
Toni Frankin-Jackson 212-101-6630
 
F

fredg

I have a field called CONTACT that has both a name and phone number as
text.

I need to separate this into two fields, NAME and PHONE. How do I
display just the name? Since the string is of variable length, how do
I define the length as a variable.

I can pull the phone number out with Right(contact,12) since it is
always ten characters long. But how do I treat the name since I never
know how long the name will be or how it will be formatted.

Examples:

Steve Jones 908-555-1211
Brenda A Smith 704-222-8899
Toni Frankin-Jackson 212-101-6630

As long as you know that the phone number is always the last 12
characters and everything else is the name:

FullName:Left([CombinedField],Len([CombinedField])-12)
 

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

Top