Return 0 for months with no records to count

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a query that counts the total number of records per Tech per month.
I'd like to see 0 for months when a Tech has no records but the NZ function
doesn't seem to be giving me that. For instance when I run the query
(below), if one tech doesn't have any records for September that month
doesn't even appear for that tech. What I tried was using the nz function
for the Count(*) but that didn't do anything. Can you guys help? Thanks!
Julie

p.s. Here's my query:

SELECT Format([HSILDateScreened],"mm") AS [Date],
Count(*) AS TotalGO,
tblHSILLog.TechID
FROM tblHSILLog
WHERE (((tblHSILLog.HSILDateScreened) Between
[Forms]![frHSILReport]![cmbBeginDate] And
[Forms]![frHSILReport]![cmbEndDate]))
GROUP BY Format([HSILDateScreened],"mm"),
tblHSILLog.TechID
ORDER BY tblHSILLog.TechID;
 
You can create a table/query of all possible months and use a join that
includes all the records from the t/q of all possible months.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top