Nick T
Nick T

Reputation: 101

How to remove special characters from the end of an Access text field?

I have a field in MS Access that contains thousands of records. The records contain names. Many of those names are followed by a special character. For instance John Smith* or Joe Smith#

I want to leave the names as they are but I want to get rid of those special characters at the end of each name. I tried find and replace but maybe I wasn't using the right syntax. Any help would be greatly appreciated. Thank You.

Upvotes: 1

Views: 1391

Answers (1)

Gord Thompson
Gord Thompson

Reputation: 123464

You could use an UPDATE query like so:

UPDATE NameTable SET NameColumn = Left(NameColumn, Len(NameColumn) - 1) 
WHERE NameColumn NOT LIKE "*[a-z]"

In the Query Builder it would look like this:

enter image description here

Upvotes: 1

Related Questions