Hi,
I have a problem trying to count a Yes/No column in my query. The column is being counted as if all the boxes are ticked but this is not the case. Does anyone know how to sort this.
SELECT tblprofiles.Jobfamily, Count(tblassimilation.PayNumber) AS CountOfPayNumber, Count(tblassimilation.KSF) AS CountOfKSF
FROM tblassimilation RIGHT JOIN tblprofiles ON tblassimilation.[Post Descriptor] = tblprofiles.Postdescriptor
GROUP BY tblprofiles.Jobfamily;
at the moment both columns are counting the same although there is only 1 box ticked in the KSF field and the payNumber field should be a count of all the staff.
SELECT tblprofiles.Jobfamily, Count(tblassimilation.PayNumber) AS StaffCount, Sum(IIf([tblassimilation].[KSF],1,0)) AS KSFCount
FROM tblassimilation RIGHT JOIN tblprofiles ON tblassimilation.[Post Descriptor] = tblprofiles.Postdescriptor
GROUP BY tblprofiles.Jobfamily;
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.