sql = "SELECT questions.adminID, questions.questionID, questions.surveyID, questions.question, "
sql = sql & "Sum([rbt1r1]/1) AS t1r1, Sum([rbt1r2]/2) AS t1r2, Sum([rbt1r3]/3) AS t1r3, "
sql = sql & "Sum([rbt1r4]/4) AS t1r4, Sum([rbt1r5]/5) AS t1r5, [r4r5]/[Total] AS Percentr4r5, "
sql = sql & "[r3r4r5]/[total] AS Percentr3r4r5, [t1r1]+[t1r2]+[t1r3]+[t1r4]+[t1r5] AS Total, "
sql = sql & "[t1r4]+[t1r5] AS r4r5, [t1r3]+[t1r4]+[t1r5] AS r3r4r5 "
sql = sql & "FROM questions INNER JOIN surveyRating ON questions.questionID = surveyRating.question "
sql = sql & "WHERE questions.surveyID = '" & request.cookies("surveyID" & "' AND questions.adminID = '" & request.cookies("collect"("adminID" & "' "
sql = sql & "GROUP BY questions.adminID, questions.questionID, questions.surveyID, questions.question;"
Thanks,
Ricky
sql = sql & "Sum([rbt1r1]/1) AS t1r1, Sum([rbt1r2]/2) AS t1r2, Sum([rbt1r3]/3) AS t1r3, "
sql = sql & "Sum([rbt1r4]/4) AS t1r4, Sum([rbt1r5]/5) AS t1r5, [r4r5]/[Total] AS Percentr4r5, "
sql = sql & "[r3r4r5]/[total] AS Percentr3r4r5, [t1r1]+[t1r2]+[t1r3]+[t1r4]+[t1r5] AS Total, "
sql = sql & "[t1r4]+[t1r5] AS r4r5, [t1r3]+[t1r4]+[t1r5] AS r3r4r5 "
sql = sql & "FROM questions INNER JOIN surveyRating ON questions.questionID = surveyRating.question "
sql = sql & "WHERE questions.surveyID = '" & request.cookies("surveyID" & "' AND questions.adminID = '" & request.cookies("collect"("adminID" & "' "
sql = sql & "GROUP BY questions.adminID, questions.questionID, questions.surveyID, questions.question;"
Thanks,
Ricky