How to create a delete query where a record contains certain crite

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

Guest

I have imported about 10K and need to clean out records that contain certain
values such as everything that contains "xyz" and have it delete just those
records. I don't have a lot of knowledge with Access, but know there is a
way to create a query and tell it that if a record contains certain letters
to delete it. If anyone can help me out I would appreciate it.

Thanks,

Keith
 
Kbass said:
I have imported about 10K and need to clean out records that contain
certain values such as everything that contains "xyz" and have it
delete just those records. I don't have a lot of knowledge with
Access, but know there is a way to create a query and tell it that if
a record contains certain letters to delete it. If anyone can help
me out I would appreciate it.

Thanks,

Keith

Are you looking for those letters in a particular field, or in every
text or memo field in the record? The former case it quite simple; the
SQL for it would be along the lines of:

DELETE * FROM MyTable
WHERE TheField Like '*xyz*';

That will delete all records that contain "xyz" anywhere in the field
named "TheField".
 
Dirk, thanks for the reply. I am trying to clean out an old email lists and
would like to search only the email field and for example if any records
contain .edu then delete the records containing .edu. I have multiple
combinations (.edu, .us, xyz.com, etc), but can just change the criteria each
time I run the query. It sure beats having to manually go through all these
records.

Thanks Again.

Keith
 

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