I have a cross tab query that is counting Patient_ID’s as the value.
Total = Nz(Count(Research.Patient_ID))+0
I have also tried:
Total = Nz(Count(Research.Patient_ID)
and….
Total = Nz(Count(Research.Patient_ID, 0)
etc. Nz() only works if at least one value is not null. However, if all of them are null, instead of seeing all 0’s, I see nothing.
This is problematic because I am using these queries as subqueries. The main query takes the values from this one (and others like it) and adds them together. Unfortunately, if one of the subqueries is entirely null, then the sum actually turns up null, regardless of whether or not should be.
For example:
subquery1: Nz(Count(Research.Patient_ID))+0
subquery2: Nz(Count(Research.All_ID))+0
mainquery: subquery1 + subquery2
if subquery1 = 4, and subquery2 = Null...
mainquery = subquery1 + subquery2
mainquery = Null
when really…
mainquery = 4
Please help.
In this query, the main query produces the sum of counts determined in two subqueries. Is this what you’re after?