I was wondering if their is a way to work with this existing query, but instead of querying MAX(auditreceiveddate) I can search instead for the value 2005 in its place?
SELECT A.LocalUnitCd, A.LocalUnitType, A.CountyCd, L.LastAuditDate, A.FiscalYear AS LastFiscalYear
FROM dbo_localUnitAudit AS A INNER JOIN [SELECT LocalUnitCd,LocalUnitType, CountyCd, MAX(auditreceiveddate) AS LastAuditDate
FROM dbo_localUnitAudit GROUP BY LocalUnitCd, LocalUnitType, CountyCd
]. AS L ON (A.LocalUnitCd = L.LocalUnitCd) AND (A.AuditReceivedDate = L.LastAuditDate) AND (A.LocalUnitType = L.LocalUnitType) AND (A.CountyCd = L.CountyCd)
WHERE (((A.LocalUnitCd)<>"100") AND ((A.LocalUnitType)="0"));
SELECT A.LocalUnitCd, A.LocalUnitType, A.CountyCd, L.LastAuditDate, A.FiscalYear AS LastFiscalYear
FROM dbo_localUnitAudit AS A INNER JOIN [SELECT LocalUnitCd,LocalUnitType, CountyCd, MAX(auditreceiveddate) AS LastAuditDate
FROM dbo_localUnitAudit GROUP BY LocalUnitCd, LocalUnitType, CountyCd
]. AS L ON (A.LocalUnitCd = L.LocalUnitCd) AND (A.AuditReceivedDate = L.LastAuditDate) AND (A.LocalUnitType = L.LocalUnitType) AND (A.CountyCd = L.CountyCd)
WHERE (((A.LocalUnitCd)<>"100") AND ((A.LocalUnitType)="0"));