L
LAS
I get this error
"You tried to execute a query that does not include the specified expression 'ProbBehaveCat1_Desc' as part of an aggregate function."
when I execute query 2. Query 1 works fine. Before Access blew up on me, a function that produced Query 2 also worked fine. HELP!!! Can anyone figure out what might be wrong?
QUERY 1 - typed directly into the query builder
SELECT Sum(fncElapsedTime(Incident_Time,Incident_Return_Time)) AS Expr1, tblStudentTracking.ProbBehaveCat1_Desc
FROM tblStudentTracking, tblStudents
WHERE tblStudents.Student_ID=tblStudentTracking.Student_ID
And tblStudentTracking.Student_ID=374
And nz(tblStudentTracking.ProbBehaveCat1_Code,'')='xOther'
GROUP BY tblStudentTracking.ProbBehaveCat1_Desc
ORDER BY tblStudentTracking.ProbBehaveCat1_Desc;
QUERY 2 - Cut and pasted from Immediate View in a function that builds this query string (end of line inserted by me)
SELECT Sum(fncElapsedTime(Incident_Time,Incident_Return_Time)) AS Expr1, tblStudentTracking.ProbBehaveCat1_Desc
FROM tblStudentTracking, tblStudents
WHERE tblStudents.Student_ID=tblStudentTracking.Student_ID
and tblStudentTracking.Student_ID = 374
And nz(tblStudentTracking.ProbBehaveCat1_Code,'')='xOther'
GROUP BY tblStudentTracking.ProbBehaveCat1__Desc
ORDER BY tblStudentTracking.ProbBehaveCat1__Desc;
"You tried to execute a query that does not include the specified expression 'ProbBehaveCat1_Desc' as part of an aggregate function."
when I execute query 2. Query 1 works fine. Before Access blew up on me, a function that produced Query 2 also worked fine. HELP!!! Can anyone figure out what might be wrong?
QUERY 1 - typed directly into the query builder
SELECT Sum(fncElapsedTime(Incident_Time,Incident_Return_Time)) AS Expr1, tblStudentTracking.ProbBehaveCat1_Desc
FROM tblStudentTracking, tblStudents
WHERE tblStudents.Student_ID=tblStudentTracking.Student_ID
And tblStudentTracking.Student_ID=374
And nz(tblStudentTracking.ProbBehaveCat1_Code,'')='xOther'
GROUP BY tblStudentTracking.ProbBehaveCat1_Desc
ORDER BY tblStudentTracking.ProbBehaveCat1_Desc;
QUERY 2 - Cut and pasted from Immediate View in a function that builds this query string (end of line inserted by me)
SELECT Sum(fncElapsedTime(Incident_Time,Incident_Return_Time)) AS Expr1, tblStudentTracking.ProbBehaveCat1_Desc
FROM tblStudentTracking, tblStudents
WHERE tblStudents.Student_ID=tblStudentTracking.Student_ID
and tblStudentTracking.Student_ID = 374
And nz(tblStudentTracking.ProbBehaveCat1_Code,'')='xOther'
GROUP BY tblStudentTracking.ProbBehaveCat1__Desc
ORDER BY tblStudentTracking.ProbBehaveCat1__Desc;