InStrRev function help

  • Thread starter Thread starter Bobby Bosco
  • Start date Start date
B

Bobby Bosco

I need to do a pattern match on last name. If the name in
the table is something like:

William T. Harding then

Lastname: Right$([IDWFullName],Len([IDWFullName])-InStrRev
([IDWFullName]," ",-1)) works great.

However if I try to nest InStrRev to get rid of the
suffix, I cannot make it work. If the data is:

William T. Harding, Jr.

and I try

Lastname: Right$([IDWFullName],Len([IDWFullName])-InStrRev
([IDWFullName]," ",(InStrRev([idwfullname],",",-1))))

but I get... Harding, Jr. All I want is Harding
Can you nest the InStrRev or is my logic inlogical ?

tia

Bobby Bosco
 
After looking at the MID function I had one of those
moments when reality took over. I got it working and just
in case someone else needs it...

Lastname: Mid$([IDWFullName],(InStr(1,[IDWFullName],". ")
+2),((InStrRev([idwfullname],",",-1)-(InStr(1,
[IDWFullName],". ")+2))))
 
Back
Top