L
Linda RQ
Hi Everyone,
Using Access 2003 and I use the query grid but post the sql so it helps you
guys. I have an audits database that we use to keep track of how correctly
our paper work is being filled out. I have many Audit Types and in each
Audit type there are Audit Items. For each audit item we select Yes, No,
or NA in the EADetailFilledOut field.
I need to report the average number of items marked yes in the
EADetailFilledOut field for one specific Audit Item from one Audit type.
I created a query and I get the correct data showing but I'm not sure how to
get the average. In my EADetailFilledOut I get both -1 (yes) and 0 (no)
returned. Can I calculate from this and if so how? It occured to me just
not that I have to make 3 queries? One that shows only -1, One that shows 0
and a final to calculate the average percent?
SELECT tblAuditItems.AItemID, tblEmpAuditDetails.EADetailFilledOut,
tblAudits.AuditName
FROM (tblAudits INNER JOIN (tblAuditItems INNER JOIN tblEmpAuditDetails ON
tblAuditItems.AItemID = tblEmpAuditDetails.EADetail_fkAItemID) ON
tblAudits.AuditID = tblAuditItems.AItem_fkAuditID) INNER JOIN
tblEmployeeAudits ON (tblEmployeeAudits.EmpAuditID =
tblEmpAuditDetails.EADetail_fkEmpAuditID) AND (tblAudits.AuditID =
tblEmployeeAudits.EmpAudit_fkAuditID)
WHERE (((tblAuditItems.AItemID)=106));
Thanks,
Linda
Using Access 2003 and I use the query grid but post the sql so it helps you
guys. I have an audits database that we use to keep track of how correctly
our paper work is being filled out. I have many Audit Types and in each
Audit type there are Audit Items. For each audit item we select Yes, No,
or NA in the EADetailFilledOut field.
I need to report the average number of items marked yes in the
EADetailFilledOut field for one specific Audit Item from one Audit type.
I created a query and I get the correct data showing but I'm not sure how to
get the average. In my EADetailFilledOut I get both -1 (yes) and 0 (no)
returned. Can I calculate from this and if so how? It occured to me just
not that I have to make 3 queries? One that shows only -1, One that shows 0
and a final to calculate the average percent?
SELECT tblAuditItems.AItemID, tblEmpAuditDetails.EADetailFilledOut,
tblAudits.AuditName
FROM (tblAudits INNER JOIN (tblAuditItems INNER JOIN tblEmpAuditDetails ON
tblAuditItems.AItemID = tblEmpAuditDetails.EADetail_fkAItemID) ON
tblAudits.AuditID = tblAuditItems.AItem_fkAuditID) INNER JOIN
tblEmployeeAudits ON (tblEmployeeAudits.EmpAuditID =
tblEmpAuditDetails.EADetail_fkEmpAuditID) AND (tblAudits.AuditID =
tblEmployeeAudits.EmpAudit_fkAuditID)
WHERE (((tblAuditItems.AItemID)=106));
Thanks,
Linda