[AccessD] Count in a query

Kaup, Chester Chester_Kaup at kindermorgan.com
Mon Sep 13 09:46:44 CDT 2010


How can I get this query to return a count of 0 if there are no records returned?

SELECT dbo_DSS_StatusChanges.Status, 
Count(dbo_DSS_StatusChanges.Status) AS [Active CO2 Injector Count]
FROM [qry Active Injectors Max Status Date] 
INNER JOIN dbo_DSS_StatusChanges 
ON ([qry Active Injectors Max Status Date].MaxOfStatusDate = dbo_DSS_StatusChanges.StatusDate) 
AND ([qry Active Injectors Max Status Date].Well_Number = dbo_DSS_StatusChanges.Completion_Name)
GROUP BY dbo_DSS_StatusChanges.Status
HAVING (((dbo_DSS_StatusChanges.Status)="CI"));

Chester Kaup
Engineering Technician
Kinder Morgan CO2 Company, LLP
Office (432) 688-3797
FAX (432) 688-3799

 
No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced.





More information about the AccessD mailing list