That error occurs when you are using an aggregate function (like count, sum, etc) and you haven't included all your select fields in the group by function.
So if you had the following SQL:
SELECT FIELD1, FIELD2, COUNT(FIELD3) FROM TABLE
you would get the aggregate function error, if you change it to:
SELECT FIELD1, FIELD2, COUNT(FIELD3) FROM TABLE GROUP BY FIELD1, FIELD2
then you won't get the error.
HTH
Leslie