When I run the following SQL in ACCESS 2007
Select Location,
COUNT(ApartmentBuildings) AS
TotalIBuildingsManaged From Apartments
Where COUNT(ApartmentBuildings) > 3
Group By Location Order By
COUNT(ApartmentBuildings) DESC;
I get the following error:
Cannot have aggregate function in where clause. How should I be forming this query to get all of the locations which have a count of ApartmentBuildings greater than 3?
Use
havinginstead ofwhere:for more information see this page