I'm using the following SQL Code in CF5:

SELECT          SurveyAnswers.SurveySubjectID,
                        SurveyAnswers.SurveyDate,
                        Avg(SurveyAnswers.NumericAnswer)
                        AS AvgOfNumericAnswer,
                        Categories.ID
FROM            (Categories INNER JOIN Questions ON Categories.ID = 
Questions.CategoryID)                   INNER JOIN SurveyAnswers ON Questions.ID = 
SurveyAnswers.QuestionID
GROUP BY                SurveyAnswers.SurveySubjectID,
                        SurveyAnswers.SurveyDate,
                        Categories.ID
HAVING          (((SurveyAnswers.SurveySubjectID)=4)
                        AND ((SurveyAnswers.SurveyDate)=#1/28/2003#)
                        AND ((Categories.ID)=38))
ORDER BY Categories.ID;

In CF5 it gives an answer of 7.90.  In Access 2000, it gives an answer of 
7.92.  If I take all the numbers and add them up in Excel, I get 
7.92.  What is wrong with this code and/or CF5 that makes it give the wrong 
average?

T

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to