2 Replies Latest reply on Sep 5, 2006 9:50 AM by Dan Bracuk

    CFPARAM from a Query

    Lemur99
      Im trying to work out a percentage from a database!

      Im new to coldfusion and with my small amount of knowledge i thought it might be possible this way!

      A count query to select all the F from the STATUS field in the database, as below

      <cfquery name="countFails" datasource="breeze">
      SELECT COUNT(STATUS)
      FROM PPS_TRANSCRIPTS JOIN PPS_PRINCIPALS ON PPS_TRANSCRIPTS.PRINCIPAL_ID = PPS_PRINCIPALS.PRINCIPAL_ID
      WHERE NAME LIKE '#FORM.allNames#'
      AND STATUS LIKE 'F'
      </cfquery>

      if i out put it i get the correct answer of 23, but i dont want to out put it i want to save it as a variable. So i put the following code in -

      <cfparam name="fails" default="#STATUS.countFails#">

      i just get -

      Error Occurred While Processing Request
      Element COUNTFAILS is undefined in STATUS.

      Am i going the correct way of doing this?

      Ta