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

Trim last 2 letters of a word and leave the preceding letters

Status
Not open for further replies.

jpkeller55

Technical User
Apr 11, 2003
131
US
I have a table that stores spanish verbs wordsAll.tbl. I am trying to make a query that will delete the last two letters of the word leaving the "root". For example:

Word Remove Root
caminar -ar camin
hablar -ar habl
comer -er com
vivir -ir viv

I am guessing it would take a combination of Trim or Left/Right commands but am unsure how to go about since the root may have different lengths. The amount to be removed would always be the same...the last two letters.

Thanks for any help!
 
mid(word,1,len(word,1)-2)

this should give it to you

I will try my best to help others so will others do!!!!!
IGPCS
Brooklyn, NY
 
I am getting a error message saying the expression has the wrong number of arguments...any ideas?
 
Mid([Word],1,(Len([Word])-2))

This worked for me...removed the second 1

Thanks again for your help!!!
 
sorry for misspelling

I will try my best to help others so will others do!!!!!
IGPCS
Brooklyn, NY
 
query that will delete the last two letters of the word
Root: Left([Word],Len([Word])-2)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top