Separating Text String

J

Jeff C

I am working with information I download to space delimited files and then
import into Access with the transfertext method. I have a new file I will be
downloading that has a field made up of a text string similar to this:

Field_1: 0890039107B/LOCAL AREA NETWORK

Can someone show me an expression I can use to separate the string:

Field_1: 0890039107B
Field_2: LOCAL AREA NETWORK

Thank you
 
O

Ofer

Does it always split into two parts, and does the / char always seperate
between the two parts?

You can use the split function

= split(FieldName,"/")(0) will return the first part
= split(FieldName,"/")(1) will return the second part
 
O

Ofer

Another option will be

=left(Fieldname,instr(Fieldname,"/")-1) 'For the first part
asasasvv
=mid(Fieldname,instr(Fieldname,"/")+1) 'For the second part
 
J

Jeff C

Thank You Ofer:

Yes the string will always need to split into two parts before and after the
"/". Your 2nd suggestion worked just fine in an update query. How would I
use your first suggestion, I could not get that to work?

These solutions are Great, I keep the old *.cdf Windows Cardfile full of the
solutions for future reference.
 
O

Ofer

You would use the second suggestion when you are using code.
For a query use the second suggestion
 

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