How to return a zero in a count query for all of a specific field

G

Guest

Here is my Query, I am counting the FP , A/C's that are on site, I have 18
sites. The result only lists the ones in the criteria. Is there a way to have
a zero for the sites that do not meet this criteria?
SELECT Count([A/C].Site) AS CountOfSite, [A/C].Site, [A/C].Status,
[A/C].Section
FROM [A/C]
GROUP BY [A/C].Site, [A/C].Status, [A/C].Section
HAVING ((([A/C].Status)="on site") AND (([A/C].Section)="FP"));

Appreciate any assistance that can be provided

JB
 
G

Guest

UNTESTED --
SELECT Sum(IIF([A/C].[Status]="on site" AND [A/C].[Section]="FP",1,0)) AS
CountOfSite, [A/C].Site, [A/C].Status, [A/C].Section
FROM [A/C]
GROUP BY [A/C].Site, [A/C].Status, [A/C].Section;
 

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

Top