G
Guest
Hello, I have a table (tbl_Audit_Answer) that has two boolean fields [AD]and
[CAR]. I have a query (qryADCount) that counts the number of [AD] that are
TRUE and another one (qryCARCount) that does the same for [CAR]. A third
query (qryScore) takes the counts from both of these queries, multiplies each
by a value in a table assocated with the penalty of an AD and CAR violation
(different values) and subtracts from 100 leaving a score. My problem is
that it is possible to go through an audit with no AD or CAR violations so
one or both of the count queries can come up blank which of course doesn't do
the score query any good.
Here is the AD query: SELECT tbl_Visit.Ship, tbl_Visit.Date,
tbl_Audit_Answer.AD, Count(tbl_Audit_Answer.AD) AS CountOfAD,
tbl_Visit.TagOffDate
FROM tbl_Visit INNER JOIN tbl_Audit_Answer ON tbl_Visit.Visit_ID =
tbl_Audit_Answer.Visit_ID
GROUP BY tbl_Visit.Ship, tbl_Visit.Date, tbl_Audit_Answer.AD,
tbl_Visit.TagOffDate
HAVING (((tbl_Visit.Ship)=[Forms]![frmNonCurrentVisits]![Ship]) AND
((tbl_Visit.Date)=[Forms]![frmNonCurrentVisits]![Date]) AND
((tbl_Audit_Answer.AD)=True));
How can I get this to sent qryScore a "0" if it can't find any records with
a true indication?
Thanks for the help.
[CAR]. I have a query (qryADCount) that counts the number of [AD] that are
TRUE and another one (qryCARCount) that does the same for [CAR]. A third
query (qryScore) takes the counts from both of these queries, multiplies each
by a value in a table assocated with the penalty of an AD and CAR violation
(different values) and subtracts from 100 leaving a score. My problem is
that it is possible to go through an audit with no AD or CAR violations so
one or both of the count queries can come up blank which of course doesn't do
the score query any good.
Here is the AD query: SELECT tbl_Visit.Ship, tbl_Visit.Date,
tbl_Audit_Answer.AD, Count(tbl_Audit_Answer.AD) AS CountOfAD,
tbl_Visit.TagOffDate
FROM tbl_Visit INNER JOIN tbl_Audit_Answer ON tbl_Visit.Visit_ID =
tbl_Audit_Answer.Visit_ID
GROUP BY tbl_Visit.Ship, tbl_Visit.Date, tbl_Audit_Answer.AD,
tbl_Visit.TagOffDate
HAVING (((tbl_Visit.Ship)=[Forms]![frmNonCurrentVisits]![Ship]) AND
((tbl_Visit.Date)=[Forms]![frmNonCurrentVisits]![Date]) AND
((tbl_Audit_Answer.AD)=True));
How can I get this to sent qryScore a "0" if it can't find any records with
a true indication?
Thanks for the help.