Hi all,
This report is going to be the end of me. I have a district with 12 offices in it. I want a user to be able to select a course (first aid for example) on a form then generate a report based on the number of employees that have had that course by office. The problem with my current query is that if an office has 0 employees that have taken the course, it does not show up on the report. I have a fancy stacked bar graph that makes the numbers easy to see, but the 0 office is not showing. I have tried a few things like an iif statement that checks if the count is 0, then make the value 0, but it doesn't work. I assume it has to do with a join, but I'm not sure how it should look. Here is the SQL statement I have right now that gets all the info:
Code:
SELECT tblOffices.ID, tblOffices.District, tblOffices.OfficeName, tblIndividualLearning.CatelogID, Count(tblIndividualLearning.EmpID) AS TotalDone, tblEmployee.Active
FROM tblOffices INNER JOIN (tblEmployee INNER JOIN (tblCourseCatelog INNER JOIN tblIndividualLearning ON (tblCourseCatelog.CatelogID = tblIndividualLearning.CatelogID) AND (tblCourseCatelog.CatelogID = tblIndividualLearning.CatelogID)) ON (tblEmployee.EmpID = tblIndividualLearning.EmpID) AND (tblEmployee.EmpID = tblIndividualLearning.EmpID)) ON tblOffices.ID = tblEmployee.Office
GROUP BY tblOffices.ID, tblOffices.District, tblOffices.OfficeName, tblIndividualLearning.CatelogID, tblEmployee.Active
HAVING (((tblOffices.District)=54) AND ((tblIndividualLearning.CatelogID)=[Forms]![frmStatsByCourse]![cbxCourses]) AND ((tblEmployee.Active)=True));
Thanks!!!