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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display only certain characters within a string 1

Status
Not open for further replies.

meagain

MIS
Joined
Nov 27, 2001
Messages
112
Location
CA
I need to display only characters between the () in a field. The bracketed portion is always at the end of the string, but varies in length.

ie:

String Result Required

lori123(hellodolly) hellodolly
lori567(hellolu) hellolu

I'm sure I've done this before, but for the life of me I can't remember how.

Thank you for your assistance
[dazed]
 
You can use Mid and Instr.
 
Something like this ?
Mid(Left(yourString,InStr(yourString,")")-1),InStr(yourString,"(")+1)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks, that was right on the money for what I requested. However, the plot now thickens :-D. There is one string that the user has set up with 2 bracketed parts. Here is the scenario with the current results and the results I need.

ie:

String Result Result Required

lori890(hello)(dolly) hello dolly

The current formula is :Mid(Left(yourString,InStr(yourString,")")-1),InStr(yourString,"(")+1)

Thanks again for your assistance.
 
Replace InStr with InStrRev

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top