Re: Query to Count, but return items that are null



Sandy wrote:
>I used the following query:
>
>SELECT tblDeclaration.Declaration, Count(*) AS NumOfDecl
>FROM tblDeclaration Left JOIN tblCalls ON tblDeclaration.DeclarationID =
>tblCalls.DeclarationID
>GROUP BY tblDeclaration.Declaration;
>
>It still isn't returning any rows that are less than 1. Any idea what I'm
>doing wrong? Also, I have to manage to use another column from tblCalls -
>CallDate, in addition to getting Count, because I need the count of each
>Declaration between two dates. [By the way, tblCalls is the Main table.]


I think the issue is that you are using Count(*). That will
count all the rows, regardless of their content. Try
changing it to:
. . ., Count(tblCalls.DeclarationID) AS NumOfDecl

--
Marsh
MVP [MS Access]
.