T
Terry
I have two tables, one of which has a field (AuditRptTbl.AuditRptYesCount)
that I want to update with the Count of "Yes" values in another table
(AuditDetailTreatmentTbl.AuditDtlCnt). I've constructed two queries, one of
which counts the values and works ok, and the other query will update a
specific column ok. Is this possible or is there another way to provide the
same functionality?
However, I've tried several different ways to combine the two into a
subquery to update my result field with the Count but receive different
errors depending on what I try. The queries are below.
Thanks for any help or direction that you can provide.
Terryomsn
Query 1
SELECT Count(AuditDetailTreatmentTbl.AuditDtlCnt) AS [Number of Counts],
AuditDetailTreatmentTbl.Medicare, AuditDetailTreatmentTbl.PhysicianOrdPres
FROM AuditDetailTreatmentTbl
GROUP BY AuditDetailTreatmentTbl.Medicare,
AuditDetailTreatmentTbl.PhysicianOrdPres
HAVING (((AuditDetailTreatmentTbl.Medicare)=On) AND
((AuditDetailTreatmentTbl.PhysicianOrdPres)="Yes"));
Query 2
UPDATE AuditRptTbl SET AuditRptTbl.AuditRptYesCount = null
WHERE (((AuditRptTbl.AuditRptID)=1));
that I want to update with the Count of "Yes" values in another table
(AuditDetailTreatmentTbl.AuditDtlCnt). I've constructed two queries, one of
which counts the values and works ok, and the other query will update a
specific column ok. Is this possible or is there another way to provide the
same functionality?
However, I've tried several different ways to combine the two into a
subquery to update my result field with the Count but receive different
errors depending on what I try. The queries are below.
Thanks for any help or direction that you can provide.
Terryomsn
Query 1
SELECT Count(AuditDetailTreatmentTbl.AuditDtlCnt) AS [Number of Counts],
AuditDetailTreatmentTbl.Medicare, AuditDetailTreatmentTbl.PhysicianOrdPres
FROM AuditDetailTreatmentTbl
GROUP BY AuditDetailTreatmentTbl.Medicare,
AuditDetailTreatmentTbl.PhysicianOrdPres
HAVING (((AuditDetailTreatmentTbl.Medicare)=On) AND
((AuditDetailTreatmentTbl.PhysicianOrdPres)="Yes"));
Query 2
UPDATE AuditRptTbl SET AuditRptTbl.AuditRptYesCount = null
WHERE (((AuditRptTbl.AuditRptID)=1));