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

Deleting last character of a text field using update query 1

Status
Not open for further replies.

nsukari

Technical User
Jul 17, 2002
26
0
0
US
I am trying to create an update query to correct the names of one table before comparing it with the other. The problem is, I have four people with the suffix of Jr. on their last name. I want to get rid of the &quot;.&quot; without having to list each name indiviually. Is there a way I can do this? I tried using &quot;<> Right([Name_Last,1)&quot; function to delete, but It doesn't work and I do not know how to delete. Is there a delete command? I've tried delete, remove, exclude, etc. Please help.

Here is an example of my query.

IIf([Name_Last]=&quot;Smithy&quot;,&quot;Smith&quot;,IIf([Name_Last]=&quot;Davisy&quot;,&quot;Davis&quot;,IIf([Name_Last]=&quot;Jonesy&quot;,&quot;Jones&quot;,IIF([Name_Last]Like &quot;*.&quot;,<>(Right([Name_Last],1)),[Name_Last]))))
 
Change this:

<>(Right([Name_Last],1))

to this...

left([Name_Last],len([Name_Last])-1)

Hope that helps.

Kevin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top