Pulling text from parenthesis

V

Victoria

I need to pull text from a parenthesis where there is text on both sides of
the desired info. For example
11294GGsewrf PPO asfdio(dfjios)sd/12

I'm using the function below, but it is not taking off the right side of the
data. What can I do to remove that as well? I'd like to continue to do this
as a function within a query.
Thanks.
-Victoria

Plan_Code:
Mid([tbl1]![Plan],InStr(1,[tbl1]![Plan],"(",1)+1,Len([tbl1]![Plan])-(InStr(1,[tbl1]![Plan],"(",1)+1))
 
J

Jeff Boyce

Already responded to in other newsgroup.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
L

Lord Kelvan

try

Plan_Code: Mid([tbl1].[Plan],InStr(1,[tbl1].[Plan],"(")
+1,Len(Right([tbl1].[Plan],InStr(InStr(1,[tbl1].[Plan],"("),[tbl1].
[Plan],")")-1))-InStr(1,[tbl1].[Plan],"("))

hope this helps

Regards
Kelvan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top