A
Allen_N
This has been bending my brain for days. I want to find all the kits that
include all of the parts listed in a table called [Find items]. If I only
wanted to select kits that contain any part in [Find items], the query would
look like this:
SELECT [Sub Kit Comps].KitName, [Sub Kit Comps].Item
FROM [Sub Kit Comps]
WHERE [Sub Kit Comps].Item
IN
(SELECT [Find Items In Kits].[Part Number] FROM [Find Items In Kits])
I've been trying to use subqueries to count the number of matches and
compare that to the count of records in [Find Items In Kits], but I'm missing
something. (I think I need to GROUP BY KitName, but I can't picture the
correct syntax.)
I've tried an SQL forum, and couldn't use the reply (it was just a
restatement of my problem). Could I interest anyone in having a crack at it?
include all of the parts listed in a table called [Find items]. If I only
wanted to select kits that contain any part in [Find items], the query would
look like this:
SELECT [Sub Kit Comps].KitName, [Sub Kit Comps].Item
FROM [Sub Kit Comps]
WHERE [Sub Kit Comps].Item
IN
(SELECT [Find Items In Kits].[Part Number] FROM [Find Items In Kits])
I've been trying to use subqueries to count the number of matches and
compare that to the count of records in [Find Items In Kits], but I'm missing
something. (I think I need to GROUP BY KitName, but I can't picture the
correct syntax.)
I've tried an SQL forum, and couldn't use the reply (it was just a
restatement of my problem). Could I interest anyone in having a crack at it?