I have the following code: -
sql = "SELECT score, avg(Score), TestID, DateTaken as 'Date Taken' " & _
"FROM Tests_Taken " & _
"WHERE UserID = '" & cmbUsers.SelectedValue.ToString & "' AND DateTaken between '" & Format(MonthCalendar1.SelectionStart, "yyyy-MM-dd") & "' and '" & Format(MonthCalendar2.SelectionStart, "yyyy-MM-dd") & "'" & _
" Group by TestID "
it keeps coming up with the error message -
Column 'Tests_Taken.Score' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
What have I done wrong please.