Newb Alert - query question

  • Thread starter Thread starter JohnB
  • Start date Start date
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
 
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
 
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"?
 
Back
Top