S
smoutsat
I am trying to make a query to show a count of how many subjects have Moved
(True/False), grouped by School. If no subjects in a certain school have
moved, I’d like the query to return a 0 instead of simply omitting the group.
For example:
3 ABC School
0 XYZ School
1 JTH School
I’m using the Nz function in my query, but instead of showing a 0 for null
groups, it’s omitting the group (just as if I didn’t use the Nz function).
Any ideas? SQL Below.
Stacey
SELECT Count(Nz([Moved],0)) AS MovedNz, ctblSchools.School
FROM ctblSchools INNER JOIN tblParents ON ctblSchools.SchoolPrefix =
tblParents.SchoolPrefix
WHERE (((tblParents.Moved)=True))
GROUP BY ctblSchools.School;
(True/False), grouped by School. If no subjects in a certain school have
moved, I’d like the query to return a 0 instead of simply omitting the group.
For example:
3 ABC School
0 XYZ School
1 JTH School
I’m using the Nz function in my query, but instead of showing a 0 for null
groups, it’s omitting the group (just as if I didn’t use the Nz function).
Any ideas? SQL Below.
Stacey
SELECT Count(Nz([Moved],0)) AS MovedNz, ctblSchools.School
FROM ctblSchools INNER JOIN tblParents ON ctblSchools.SchoolPrefix =
tblParents.SchoolPrefix
WHERE (((tblParents.Moved)=True))
GROUP BY ctblSchools.School;