[AccessD] Count in query problem

Kaup, Chester Chester_Kaup at kindermorgan.com
Mon Jun 14 11:28:51 CDT 2010


I have a count function in a query that I want to return a zero (0) is there are no records that match. I have tried count, dcount and left join. All I get is no records returned. Here is one version of the query.

SELECT dbo_DSS_StatusChanges.Status, DCount("Status","[dbo_DSS_StatusChanges]") 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, DCount("Status","[dbo_DSS_StatusChanges]")
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