A Delete Query

G

Guest

I have 2 tables called, say, Maintable and Secondtable. School students are
identified in these tables by 2 fields in each table, one called Centre which
identifies the school with a 5 digit alphanumeric code and the other called
Cand which is the 4 digit student number (Cand is unique in the school but
not in the table since each school will start numbering students from 0001.

My problem is that I need to delete records from Secondtable if the student
does not exist in the first table. So, I take Centre and Cand for each
record in turn in Secondtable and then I need to look at Maintable to see if
a student exists with the same values of Centre and Cand. If not then I want
to delete the record in Secondtable.

It''s easy to identify the students that exist, but apparently not so east
to identify those who don't.

Thanks in anticipation of any help.

Jim Jones
 
E

Edward G

Should be pretty straight forward Unmatched Query. In database window select
Query tab and click NEW.
From the list of queries select "Find Unmatched Query Wizard". The wizard is
self explanatory and the resultant
recordset is deletable by selecting all records and clicking the delete
button.
 

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

Similar Threads


Top