The following code is meant to return all project names for the second most recent date of all dates in the table. I however keep getting the error "Your query does not include the specified expression 'Project Name' as part of an aggregate function. What am I doing incorrectly?
SELECT DISTINCT TOP 2 Max([Report Date]) AS MaxReportDate
FROM RedProjectHistorical
WHERE (((RedProjectHistorical.[Report Date]) Not In (Select Max([Report Date]) FROM RedProjectHistorical)));
Try with the simpler: