Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parse info

Status
Not open for further replies.

pamgdevlin

Programmer
Nov 24, 2003
14
US
Say I have a text field with 5 words, each separated by a space.....for example:

Mary had a little lamb

Using a query, what would be the best way to pull out the third "word" 'a'??

Any suggestions would be appreciated.

Thanks
 
Create your own public function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi!

In a query you would do it like this:

Mid(YourField, InStr(InStr(YourField," ") + 1, YourField, " "), InStr(InStr(InStr(YourField," ") + 1, YourField, " ") + 1, YourField, " ") - InStr(InStr(YourField," ") + 1, YourField, " "))



Jeff Bridgham
Purdue University
Graduate School
Data Analyst
 
Hi!

A small error:

ThirdWord: Mid([YourField],InStr(InStr([YourField]," ")+1,[YourField]," ")+1,InStr(InStr(InStr([YourField]," ")+1,[YourField]," ")+1,[YourField]," ")-InStr(InStr([YourField]," ")+1,[YourField]," ")-1)

hth


Jeff Bridgham
Purdue University
Graduate School
Data Analyst
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top