Getting a null value to display zero in count query

K

kahaymon

How can I get this query to yield a zero when the count of the field "ID" is
zero?

SELECT [QRY IP Falls U parameter].[Unit location of incident], [QRY IP Falls
U parameter].Shift, Count([QRY IP Falls U parameter].ID) AS [2005 Falls]
FROM [QRY IP Falls U parameter]
WHERE ((([QRY IP Falls U parameter].[Date of incident]) Between #1/1/2005#
And #12/31/2005#))
GROUP BY [QRY IP Falls U parameter].[Unit location of incident], [QRY IP
Falls U parameter].Shift;


Thanks.
 
M

Michel Walsh

Nz(COUNT([QRY IP Falls U parameter].ID), 0)

instead of

Count([QRY IP Falls U parameter].ID)



Vanderghast, Access MVP
 

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