Table as Criteria for different Table

S

Sbp18

I am using Access 2003 and have a question regarding criteria. I have run
one query that contains the criteria that I would like to use for another
query. In this other query, I want to use the whole column as my criteria
for one field and then use the column right next to it as a criteria for
another field.

I have used parameters, but I know there is a much simpler way where I do
not have to individually type in the parameters for my criteria.

For example, I need the Business Unit and Affiliate (2 different columns)
from Step 2 table as part of Step 3 Query field's Business Unit and Affiliate
(2 different columns) to run entries.
 
S

Smartin

Sbp18 said:
I am using Access 2003 and have a question regarding criteria. I have run
one query that contains the criteria that I would like to use for another
query. In this other query, I want to use the whole column as my criteria
for one field and then use the column right next to it as a criteria for
another field.

I have used parameters, but I know there is a much simpler way where I do
not have to individually type in the parameters for my criteria.

For example, I need the Business Unit and Affiliate (2 different columns)
from Step 2 table as part of Step 3 Query field's Business Unit and Affiliate
(2 different columns) to run entries.

Hello,

If I read you right, you want to "chain" or "nest" your queries. You can
reference a query in another query and treat just like a table.

For instance, if the underlying query is called "QCriteria" and looks
like this:

SELECT BusUnit, Affiliate
FROM MyTable;

You can include it in another query:

SELECT Stuff
FROM QCriteria AS Q INNER JOIN MyOtherTable AS X
ON <whatever joins these>
WHERE
X.<something> = Q.BusUnit AND
X.<something else> = Q.Affiliate;

This is a trivial example for demonstration. You can join queries, other
tables and so on, just like in a table-based query. You can use the
query designer to drag and drop everything. Plus, you can do this sort
of nesting to many levels.

HTH
 

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