>SELECT d.GroupId, > Sum(d.cert_complete) AS SumOfcert_complete, > Count(d.cert_complete) AS CountOfcert_complete > FROM (SELECT DISTINCT s.GroupId, e.EmployeeID, IIf(e.Certified Is Null,0,1) AS cert_complete > FROM ((Stores AS s > INNER JOIN EmployeeStores AS es ON s.StoreId=es.StoreId) > INNER JOIN Employees AS e ON es.EmployeeId=e.EmployeeID) > INNER JOIN Titles AS t ON e.TitleId=t.TitleId WHERE t.IsManager=True) AS d > GROUP BY d.GroupId; >>
SELECT d.GroupId, Sum(d.cert_complete) AS SumOfcert_complete, Count(d.cert_complete) AS CountOfcert_complete FROM (SELECT DISTINCT s.GroupId, e.EmployeeID, IIf(e.Certified Is Null,0,1) AS cert_complete FROM ((Stores AS s INNER JOIN EmployeeStores AS es ON s.StoreId=es.StoreId) INNER JOIN Employees AS e ON es.EmployeeId=e.EmployeeID) INNER JOIN Titles AS t ON e.TitleId=t.TitleId WHERE t.IsManager=True) AS d GROUP BY d.GroupId UNION ALL SELECT 0 as GroupId, Sum(d.cert_complete) AS SumOfcert_complete, Count(d.cert_complete) AS CountOfcert_complete FROM (SELECT DISTINCT s.GroupId, e.EmployeeID, IIf(e.Certified Is Null,0,1) AS cert_complete FROM ((Stores AS s INNER JOIN EmployeeStores AS es ON s.StoreId=es.StoreId) INNER JOIN Employees AS e ON es.EmployeeId=e.EmployeeID) INNER JOIN Titles AS t ON e.TitleId=t.TitleId WHERE t.IsManager=True) AS dI'm not sure if this will work in Access, but worth a quick try.