MID

  • Thread starter Thread starter JE
  • Start date Start date
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.
 
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.

--
Message posted via AccessMonster.com


.
 
Back
Top