Three things I noted...
1. There are a lot of duplicated columns in the result list...I removed 
those to make it easier to read and debug
2. It looks to me like tblevalanswerresults needs to be joined to both 
tblquestions and tblanswers...see below
3. When you join on tblEvaluations like you did previously, and then 
filter with a WHERE clause, you may get instances where you won't return 
some of the questions in a set because none were answered for that 
instructor.  I moved the filtering on instructor up into the join.

If this doesn't work, just do a dump of each table and post that 
somewhere.  It will be easier to debug with the whole picture.

SELECT
Q.questionID,Q.questionsetID,Q.question,ARS.answersetname,A.answerID,A.answername,A.answervalue,
 
COUNT(EAR.answerID) AS numAnswers
FROM   tblquestions Q
INNER JOIN   tblanswersets ARS USING (answerSetID)
INNER JOIN   tblanswers A USING (answerSetID)
LEFT JOIN  (tblevalanswerresults EAR
INNER JOIN tblEvaluations E
ON E.evalID = EAR.evalID AND E.InstructorID = '#SESSION.CollegeID#')
ON A.answerID = EAR.answerID AND Q.QuestionID = EAR.QuestionID
GROUP BY 
Q.questionID,Q.questionsetID,Q.question,ARS.answersetname,A.answerID,A.answername,A.answervalue

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 and Flex 2 
Build sales & marketing dashboard RIA’s for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:273259
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to