Where are you 0?

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

Guest

I have a query that counts the # of priorities to display them on a report.
It works great but now I ran into the problem that if there isnt a record for
a certain priority I need it to display 0 instead of not displaying anything
at all.

SQL Statement

SELECT MainRepairData.StructureID, Count(MainRepairData.Priority) AS
CountofPriority FROM MainRepairData
WHERE (((MainRepairData.Priority)="P1"))
GROUP BY MainRepairData.StructureID
HAVING (((MainRepairData.StructureID)=[Forms]![Contents]![StructureID]));

Thanks
 
Joel,

Try it like this...
SELECT Count(MainRepairData.Priority) AS CountofPriority
FROM MainRepairData
WHERE ((MainRepairData.Priority="P1") AND
(MainRepairData.StructureID=[Forms]![Contents]![StructureID]))
 
Back
Top