When query returns null, I need a zero value as results are used in another query
Posted on 2004-10-26
I have looked over the answers to what seems to be this question, but do not get them to work. What I have is a query that if there are no rows to count, does not give me any return value, ie., Null. However, the results of this query are used in another query and I must have a zero value-otherwise the second query gives me all nulls for the other fields in it despite the fact that their base queries do return values.
SELECT IIf(IsNull(Count([tblDocumentsReturned].[Account])),0,(Count([tblDocumentsReturned].[Account]))) AS MutualFund
WHERE (((tblDocumentsReturned.DateReceived)<=[FORMS]![frmMatrixDialog]![txtEnd]) AND ((tblDocumentsReturned.DocStatus)="Mutual Fund"))
GROUP BY tblDocumentsReturned.Product