2 Replies Latest reply on Nov 2, 2006 3:09 AM by Stefan_K.

    output query results in sql transaction code

    Level 7
      Is the code below valid? I think the comma at the end of my variable is
      throwing an error when I run this.

      Eg. "#trim(product)#",

      I need the comma however to make the statement correct except after the last
      record. Is there any way around that?



      <cfquery name="calc" datasource="#client.dsn#" username="#client.username#"
      password="#client.password#">
      SELECT *
      FROM order_history
      WHERE OrderNo='823719'
      AND product in (<cfoutput
      query="backorders">"#trim(product)#",</cfoutput>)
      AND invoice < #max.invoice#
      ORDER BY invoice desc
      </cfquery>