Query to List Records in Table 1 where fields match Table 2

M

MHenry

I have a table (Table 1) with 30,000 records (sales of merchandise).
I would like to create a query that looks up 35 different articles
listed in Table 2 and generates a list of all sales of those articles.

I tried doing this in the Query itself, but after listing about 20
different articles in the Criteria row, the query would accept no more
articles.

Will someone help me get this to work?

Thanks, MHenry
 
D

Dirk Goldgar

MHenry said:
I have a table (Table 1) with 30,000 records (sales of merchandise).
I would like to create a query that looks up 35 different articles
listed in Table 2 and generates a list of all sales of those articles.

I tried doing this in the Query itself, but after listing about 20
different articles in the Criteria row, the query would accept no more
articles.

Will someone help me get this to work?

Thanks, MHenry

Join the two tables in your query, and you won't need the criteria rows
at all. For (simple) example, SQL like this:

SELECT Table1.*
FROM Table1 INNER JOIN Table2
ON Table1.ProductID = Table2.ProductID;

That will yield only those records from Table1 that have a matching
ProductID in Table2.
 

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