How to delete certain characters from a field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a Name field in a table that contains special characters like commas,
hyphens, quotes, etc... I need to be able to have it just be alpha so I can
compare it to another name field and return matches. Can you show me an
example query to get this done.

Existing Data:
Smith, John

Needs to look like:
Smith John

Thanks.
 
An alternative to Lynn's suggestion is to use the Replace function:

Replace([YourNameField], ",", "")

Again, though, you will need to modify it for other characters. One
advantage, though, is that it nests easily:

Replace(Replace(Replace([YourNameField], ",", ""), "-", ""), ";", "")

will removes commas, hyphens and semi-colons.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top