I have managed to create a select query that does what I want, but can't seem to incorporate it into the total table.
Code:
SELECT Product_Number, Count(*) AS Product_HeadCount
FROM Resource_Pool
WHERE (((Resource_Pool.Resource_Pool_Group) Like "*TSmith*"))
GROUP BY Resource_Pool.Product_Number;
Which returns data:
ProductID Headcount
12345 20
6789 08
23452 16
67894 05
57923 26
This gets me the numbers that I want. I can't seem to pull this through a table though. I have tried a sub query:
Code:
SELECT DISTINCT Resource_Data.Product_Number, Resource_Data.Product_Manager_Name, Resource_Data.Resource_Pool_Group, Manager.Team, Resource_Data.[Resource_Pool_Group_Manager], (SELECT Product_Number, Count(*) AS Product_HeadCount
FROM Resource_Pool
WHERE (((Resource_Pool.Resource_Pool_Group) Like "*TSmith*"))
GROUP BY Resource_Pool.Product_Number) AS Product_Headcount
FROM Resource_Data INNER JOIN Manager ON Resource_Data.Product_Manager_Name = Manager.Manager_Name
WHERE (((Resource_Data.Product_Manager_Name)="Albert King"));
I keep getting an error: "At most one record can be returned by this subquery". I want my data to appear:
ProductID Manager GroupName TeamName Headcount
12345 Bob Smith TSmith Sharks 10
Any clue on how to get around this error?