M
mogll
I have a dbase to track internal audits by facility. In each report, I want
to show the current audit date and the prior audit date for that facility.
My SQL skills have little to be desired, but here's what I have so far:
SELECT tblAudits.intSiteID, tblAudits.dtmClose, tblAudits.lngAuditID,
tblAudits.txtAuditType
FROM tblAudits
WHERE (((tblAudits.txtAuditType)="HSEQ-IMS")),
(SELECT Max(tblAudits.dtmClose) FROM tblAudits as A
WHERE A.intSiteID=B.intSiteID and A.dtmClose < B.dtmClose) as PriorAudit
FROM tblAudits as B;
I keep getting a syntax error. Help. Thanks.
to show the current audit date and the prior audit date for that facility.
My SQL skills have little to be desired, but here's what I have so far:
SELECT tblAudits.intSiteID, tblAudits.dtmClose, tblAudits.lngAuditID,
tblAudits.txtAuditType
FROM tblAudits
WHERE (((tblAudits.txtAuditType)="HSEQ-IMS")),
(SELECT Max(tblAudits.dtmClose) FROM tblAudits as A
WHERE A.intSiteID=B.intSiteID and A.dtmClose < B.dtmClose) as PriorAudit
FROM tblAudits as B;
I keep getting a syntax error. Help. Thanks.