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

variable length trim of unwanted chars

Status
Not open for further replies.
Dec 18, 2006
6
US
I have [field1] with a variable length name where I need to remove the fixed proceeding and trailing chars.
example
ACC1201HOA
ACC415HOA
ACC1851HOA

so end up with just

1201
415
1851

I'm right clicking on the Update to: of my Update query, chosing Build and trying to use some previous RTrim, LTrim examples, and getting no where accept completely overwritting my values..

Thanks
 
To remove 3 leading and 3 trailing chars:
Mid(Left(field1,Len(field1)-3),4)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
pwise option leaves me with 0
phv Access converts to Mid(Left("field1",Len("field1")-3),4) and leave me with blank fields
 
In my post, replace field1 with the real name of you field ...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Replacing the " "with [ ] worked

Mid(Left([field1],Len[field1])-3),4)

many thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top