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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|