Newb Alert - query question

J

JohnB

How would I do this?
I have a table with a field that contains the city and state in this format:
city, state abbreviation
There are records in the table with about 6 different city/states.
I want to delete all records, except for one city/state.
I can create a query that shows only records for that city.
But I need to somehow apply that to the table, so that I only end up with
the records containing that city.

TIA
 
J

John Spencer

WHY? As in why do you want to delete records from the table. You should be
able to use the query as the source for anything you need to do.

STEP 1: BACKUP your data before attempting the following.
STEP 2: BACKUP your data before attempting the following.

Without a backup you cannot restore the data if this does not work the way you
expect.
You can delete all the records using a delete query. The query would look like

DELETE
FROM SomeTable
WHERE CityField Not Like "Chicago*"


John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 
J

JohnB

Well... to do what I ultimately need to do, and do it WITHOUT deleting those
records is WAY over my head.
I need to link 2 tables, in separate files, and then run a "Find Unmatched
Records" query. But it only applies to that one city, in that one table..

How do you do a "delete query"?
 

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

Top