Hello
I have a query where I select certain rows based on User, Department, Year and Month.
that gives me a list of rows for the specific user I want to look at
Then I want to count items within these rows based on what is in the fields.
For example Sum(IIF([CorrectProduct]="YES",1,0)+IIF([RemarkCodeCorrect] = "YES",1,0))
I can count the items easily unless my criteria returns no rows based on the initial criteria. I want the query to display a ZERO and it returns nothing.
I've tried Nz(Sum(IIF([CorrectProduct]="YES",1,0)+IIF([RemarkCodeCorrect] = "YES",1,0)),0) but that doesn't come out right.
I've also tried Count(IIF([CorrectProduct]="YES",1,0)+IIF([RemarkCodeCorrect] = "YES",1,0))
again with no luck. I know it is something really simple but I can't wrap my brain around it today.
Any help is greately appreciated.

I have a query where I select certain rows based on User, Department, Year and Month.
that gives me a list of rows for the specific user I want to look at
Then I want to count items within these rows based on what is in the fields.
For example Sum(IIF([CorrectProduct]="YES",1,0)+IIF([RemarkCodeCorrect] = "YES",1,0))
I can count the items easily unless my criteria returns no rows based on the initial criteria. I want the query to display a ZERO and it returns nothing.
I've tried Nz(Sum(IIF([CorrectProduct]="YES",1,0)+IIF([RemarkCodeCorrect] = "YES",1,0)),0) but that doesn't come out right.
I've also tried Count(IIF([CorrectProduct]="YES",1,0)+IIF([RemarkCodeCorrect] = "YES",1,0))
again with no luck. I know it is something really simple but I can't wrap my brain around it today.
Any help is greately appreciated.
