A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

MID



 
 
Thread Tools Display Modes
  #1  
Old February 21st, 2010, 10:10 PM posted to microsoft.public.access.gettingstarted
JE
external usenet poster
 
Posts: 68
Default MID

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.
  #2  
Old February 21st, 2010, 11:05 PM posted to microsoft.public.access.gettingstarted
KenSheridan via AccessMonster.com
external usenet poster
 
Posts: 1,610
Default MID

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

JE wrote:
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
http://www.accessmonster.com/Uwe/For...arted/201002/1

  #3  
Old February 22nd, 2010, 02:30 AM posted to microsoft.public.access.gettingstarted
JE
external usenet poster
 
Posts: 68
Default MID

Thanks Ken, worked like champ!

"KenSheridan via AccessMonster.com" wrote:

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

JE wrote:
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
http://www.accessmonster.com/Uwe/For...arted/201002/1

.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:43 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.