SELECT pc.CaseCounty, pc.CaseYear, pc.MinOfCase, pc.MaxOfCase, pc.CasePrecinct, [Missing Cases].Case
FROM
(SELECT [Processed Cases].CaseCounty, [Processed Cases].CaseYear, Min([Processed Cases].Case) AS MinOfCase, Max([Processed Cases].Case) AS MaxOfCase, [Processed Cases].CasePrecinct
FROM [Processed Cases]
WHERE [Processed Cases].CaseCounty IN ("gry","tar","col","hay","den")
GROUP BY [Processed Cases].CaseCounty, [Processed Cases].CaseYear, [Processed Cases].CasePrecinct
) AS pc
LEFT JOIN [Missing Cases] ON ((pc.CaseCounty=[Missing Cases].CaseCounty) AND (pc.CasePrecinct=[Missing Cases].CasePrecinct) AND ([Missing Cases].Case<pc.MaxOfCase));
|