Deleting excluded data from original query

P

Pete

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?
 
S

Sally

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?
 
N

Nikos Yannacopoulos

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?
 

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