When dealing with GROUPed queries (where a GROUP BY clause exists) only items which are either themselves GROUPed BY, or are aggregated, can be displayed.
Aggregation is selecting a value which somehow represents the whole group of that item.
Aggregate functions are listed in the "Total" row in the Query Definition grid after selecting the Sigma button. This includes Sum(), Max(), Min(), First(), Last() etc.
It also includes Group. This means that the item is used to determine which records should be treated as together in a group.
A grouped item doesn't change in the group, so logically can be used directly in the SELECT clause.
All other items do, so must include something to indicate what should be used. Even an Expression must consist of only grouped or aggregated items.
Your problem is that you're trying to refer to a field, within a grouped query, which has no logical meaning.
Consider :
Table Name=[tblData] - Field Type
-
Class String
-
StudentName String
-
ExamScore Number
- Class StudentName ExamScore
-
Maths Andrew 55
-
Maths Brian 60
-
Maths Charles 65
-
Maths David 70
-
Maths Edward 75
-
Maths Francis 80
-
Maths Gerald 85
- SELECT [Class]
-
Sum([ExamScore]) AS SumExams
-
-
FROM tblData
Result
This illustrates both types of acceptable forms in a GROUP BY query.
Now consider how much sense there would be within this query to try to show the [StudentName]?
On its own it would have no meaning within the context. It would be possible (though hard to see the use) to use First([StudentName]).