Can't have aggregate function in GROUP BY clause <clause>. (Error 3098)

See Also

You cannot use an aggregate function in the GROUP BY clause of an SQL statement.