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

Removing Part of Code 1

Status
Not open for further replies.

lars7

Technical User
Aug 16, 2005
817
GB
Hi,
I need to remove part of a code in a field so that I can compare the rest with another code "PTB69REV1". The part I want to remove is always at the end but has a number that will always increase, ie, Rev, Rev1, Rev2, Rev3 up to Rev12 at the moment.

I have tried to replace the end of the code like:

Expr1: Replace(Replace(Replace([Local Job Reference],'rev',""),'rev1',""),'rev2',"")

but this only works for the first one and would always need to be amended as the Rev number grows.

Does anyone know the best way to solve this?
 
I'd try something like this:
Expr1: Left([Local Job Reference], InStr([Local Job Reference],'rev')-1)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 

Hi PH,

Works great, Cheers.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top