Re: Extracting the last word in a string

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



"robboll" <robboll@xxxxxxxxxxx> wrote in message
news:4dd5c8fa-de8d-46e3-b9de-8053a32836a9@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
What is the best method of extracting the last word in a string?
Example Table/Field1:

Field1
There once was a time
The old man sat
Two peas in a pod
One bird in the hand

function to extract the last word:

FunResult
time
sat
pod
hand

If it were the first word it would be: mid(Field1,1,instr(1,field1,"
"))



Check out the InstrRev function... checks from the end of the string.

--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
In Loving Memory - http://www.vbsight.com/Remembrance.htm


.



Relevant Pages

  • Re: Laff also bad for cycling
    ... > recommendation is for you and Laff to start an Obsessive Compulsive ... You and Laff are two peas in a pod full of boredom juice - imagine ...
    (rec.bicycles.racing)
  • peas twinkle variety
    ... I have now eaten the first batch but decided to ... pod them because the shell was very stringy. ... Do i eat the whole pod or just the peas. ...
    (rec.gardens.edible)
  • Re: Define a clock
    ... Two peas in a pod. ... "Time on a linear clock in S' as compared to it's twin in S as both observed ... Ergo it is "AllYou" that is Dinky's alter-ego. ...
    (sci.physics.relativity)
  • Re: Master P. On Dancing With The Stars
    ... it's like two peas in a pod. ... >> IP 65.26.201.54 and the Basement, together forever ...
    (rec.sport.pro-wrestling)
  • Re: Aweful quiet in here................
    ... peas in a pod. ... but I have little patience for either stupidity or the games you ...
    (rec.boats)