MID

J

JE

I have a table with data such as:

CALL 100 BAIDU COM INC SPONS EXP 01-16-10
PUT 100 APPLE INC COM EXP 03-20-10

I need to pull out all information after 100 and stop when it reaches EXP.

Is MID the best function for this?

Also, I am not using VBA - only a simple design view query.

Many thanks for assistance or direction.
 
K

KenSheridan via AccessMonster.com

Try:

Trim(Mid([YourField],Instr([YourField],"100")+3,(Instr([YourField],"Exp"))-
Instr([YourField],"100")-3))

or:

Trim(Mid([YourField],Instr([YourField],"100")+3,(Instr([YourField],"Exp"))-
(Instr([YourField],"100")+3)))

both of which are mathematically equivalent.

It does rather look like you are recording more than one attribute in a
single column, however, so I'm hoping you are intending to use this parsing
of the value to split it into several columns in order to normalize the table.


Ken Sheridan
Stafford, England
 
J

JE

Thanks Ken, worked like champ!

KenSheridan via AccessMonster.com said:
Try:

Trim(Mid([YourField],Instr([YourField],"100")+3,(Instr([YourField],"Exp"))-
Instr([YourField],"100")-3))

or:

Trim(Mid([YourField],Instr([YourField],"100")+3,(Instr([YourField],"Exp"))-
(Instr([YourField],"100")+3)))

both of which are mathematically equivalent.

It does rather look like you are recording more than one attribute in a
single column, however, so I'm hoping you are intending to use this parsing
of the value to split it into several columns in order to normalize the table.


Ken Sheridan
Stafford, England
I have a table with data such as:

CALL 100 BAIDU COM INC SPONS EXP 01-16-10
PUT 100 APPLE INC COM EXP 03-20-10

I need to pull out all information after 100 and stop when it reaches EXP.

Is MID the best function for this?

Also, I am not using VBA - only a simple design view query.

Many thanks for assistance or direction.

--



.
 

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