I have a query that counts the number of records for each department in my table by a date range. If a department is not represented, I need to know so we can contact them.
The count seems like it ignores nil values and NZ() did not fix the problem. As always, I seem to have problems when nil values are involved and need help!
Here is the code.
SELECT tblSharepointHHSurveys.fldDept, NZ(Count(tblSharepointHHSurveys.fldDept),0) AS Denominators
FROM tblSharepointHHDepartments RIGHT JOIN tblSharepointHHSurveys ON tblSharepointHHDepartments.fldUnit = tblSharepointHHSurveys.fldDept
WHERE (((Format([fldDate],"Short Date")) Between [Forms]![frmDateRange]![fldFromDate] And [Forms]![frmDateRange]![fldThruDate]))
GROUP BY tblSharepointHHSurveys.fldDept;
Thank you very much,
Jerold