3 Replies Latest reply: Apr 10, 2012 3:05 PM by Owain North RSS

    Get Results For Most Wrong Answers

    Merle_Hanson

      I've googled this to death and can't seem to get the right output...

       

      I can get it close with the right amount of no answers for each question...

      But I can't order it correctly by most answered no...

       

      Any help is appreciated...

       

      Basically I want to order them by the most amount of no answers first... etc...

       

      Coding below gets me the proper output - but not ordered by most...

      Changing to order by recordcount or QCount errors...

       

      cfquery name="allans" datasource="#ds#">
      SELECT
      qid, count(qid) as Qcount
      FROM answer
      where answer = 'no'
      GROUP BY qid
      ORDER BY qid
      cfquery>

      <cfoutput query="allans" group=qid>    
      <hr>#qid# - #QCount#<br>    
      </cfoutput>

       

      ColdFusion8 - MS Access Database

       

      Any help is appreciated thx...