Deleting excluded data from original query

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

Guest

I have a question about how do I eliminate data from a query. I have 7 tables that I’m pulling information from. 1 of those table is and exclusion table. If we find matching data from my original query in the exclusion table, I am to eliminate it from my report. How do I do this. Do I use a subquery?
 
Put this expression in the primary key field in your original query:

Not In (Select [NameOfPrimaryKey] From NameOfExclusionTable)


--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com


Pete said:
I have a question about how do I eliminate data from a query. I have 7 tables
that I'm pulling information from. 1 of those table is and exclusion table. If
we find matching data from my original query in the exclusion table, I am to
eliminate it from my report. How do I do this. Do I use a subquery?
 
Pete,

In your original query, join your exclusion table to the main one on the
common key, double-click on the join and change the join type (radio button
selection) to the one that reads "Select all recodrs from (your main table)
and all records from (your exclusion table) where..."
Then get the joined field from the exclusion table in the query grid, and in
the criteria line below it type "is Null" (without the quotes).
This will not delete anyhting form your original table, but will block those
records from making it to the query resuls and, in turn, the report.

HTH,
Nikos

Pete said:
I have a question about how do I eliminate data from a query. I have 7
tables that I'm pulling information from. 1 of those table is and exclusion
table. If we find matching data from my original query in the exclusion
table, I am to eliminate it from my report. How do I do this. Do I use a
subquery?
 
Back
Top