I have the query
SELECT tbl_ImportedRepairs.InvoiceNumber
FROM tbl_ImportedRepairs
WHERE tbl_ImportedRepairs.TrinityBatch IS NULL
GROUP BY tbl_ImportedRepairs.InvoiceNumber
HAVING (((Sum(IIf([BlakeApproval]=False,1,0)))=0));
This query finds line items in a table and gives me the invoice number ONLY if all the line items have been approved.
I would like to build on that and say:
Give me Invoice Number if ALL line items have been approved
AND
All The Updated Responsibility code are 1
I am thinking it might be like this
SELECT tbl_ImportedRepairs.InvoiceNumber
FROM tbl_ImportedRepairs
WHERE tbl_ImportedRepairs.TrinityBatch IS NULL
GROUP BY tbl_ImportedRepairs.InvoiceNumber
HAVING (((Sum(IIf([UpdatedResponsibilityCode]=1,1,0)))=0)) AND HAVING (((Sum(IIf([BlakeApproval]=False,1,0)))=0));
But of course that doesnt work and I am getting
Syntax error (missing operator) in query expression '(((Sum(IIf(BlakeApproval=Flase,1,0)))=0)) AND'