datas_brother
New member
- Local time
- Today, 09:46
- Joined
- Jul 30, 2010
- Messages
- 8
HI,
I'm trying to find the sum of inspections per inspector and area. Each inspector works either alone or in a team of 2. I have a table with the fields Inspector_1 and Inspector_2. I've written 2 queries that give me the correct sums by inspector and area (one for each field above). The number of rows in the first query is higher since not all inspectors work in multiple areas and in teams. When I try to combine both queries into one I am only showing entries for inspectors that have worked as inspector_2 in a particular area. I. e. if an inspector in area A has never worked as Inspector_2 in that area he will not be returned.
Here is the code for the third query:
I'm likely overlooking something really simple and would appreciate any help I can get.
Thanks:
DB
I'm trying to find the sum of inspections per inspector and area. Each inspector works either alone or in a team of 2. I have a table with the fields Inspector_1 and Inspector_2. I've written 2 queries that give me the correct sums by inspector and area (one for each field above). The number of rows in the first query is higher since not all inspectors work in multiple areas and in teams. When I try to combine both queries into one I am only showing entries for inspectors that have worked as inspector_2 in a particular area. I. e. if an inspector in area A has never worked as Inspector_2 in that area he will not be returned.
Here is the code for the third query:
Code:
SELECT Item_Count_Insp1.Inspector, [Item_Count_Insp1]![SKU_Count]+[Item_Count_Insp2]![SKU_Count] AS SKU_Sum, Item_Count_Insp2.[QA Area]
FROM Item_Count_Insp1 INNER JOIN Item_Count_Insp2 ON (Item_Count_Insp1.[QA Bereich] = Item_Count_Insp2.[QA Bereich]) AND (Item_Count_Insp1.Inspector= Item_Count_Insp2.Inspector)
GROUP BY Item_Count_Insp1.Inspector, [Item_Count_Insp1]![SKU_Count]+[Item_Count_Insp2]![SKU_Count], Item_Count_Insp2.[QA Bereich]
ORDER BY Item_Count_Insp2.[QA Area];
Thanks:
DB