Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report query works fine standalone but fails in report

Status
Not open for further replies.

slicendice

Programmer
Jun 28, 2002
164
GB
Hi
I have a report that is based on an SQL query. When I run the query as a standalone query, it works fine and brings back the correct data.
However, when I embed the query into a report and try to run it, I get the error:

"This expression is typed incorrectly, or it is too complex to be evaluated. Try simplifying the expression by assigning parts of the expression to variables."

How come it fails in the report?

Don't know if it helps but the query involved is:

SELECT Qualifications.Qualification,
StudentQual.DateQualified,
Students.Salutation,
Students.Surname,
Students.FirstName,
StudentQual.InstructorName
FROM Students INNER JOIN (Qualifications INNER JOIN StudentQual
ON Qualifications.QualificationID = StudentQual.QualificationID)
ON Students.StudentID = StudentQual.StudentID
WHERE Students.CurrentQualificationID=[StudentQual].[QualificationID]
ORDER BY Qualifications.Qualification,
StudentQual.DateQualified DESC ,
Students.Surname,
Students.FirstName;

There are 3 tables involved:

Students - holds student details including ref no of their current qualification
Qualifications - reference table with all qualifications and their associated ref nos
StudentQual - links a student to one or more qualifications - also includes the date the qualification was achieved

Hope this makes sense!

Thanks
 
It isn't necessarily your query. An invalid or complex expression in an unbound control on your report can raise this error too.
 
have you tried saving your query and then calling the query in your report ? (as opposed to embedding the code in the report)
Best of Irish Luck, David.
djwilkes@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top