1 Reply Latest reply on Apr 22, 2014 9:03 AM by Carl Von Stetten

    How get unique option fileds in a dynamic dropdown box

    fluiter

      I'm trying to get single select options in a dropdown menu.

      The data is coming from two database.

      My CFQuery looks like


      <cfquery name="related" datasource="ISSUE">
      SELECT sparprod
      FROM Related
      where Active = 'Yes'
      union all
      select sparprod from TBL_issue
      WHERE issue_number = <cfqueryparam value="#URL.issue_number#" cfsqltype="cf_sql_numeric">
      ORDER BY sparprod ASC
      </cfquery>

       

        <td>

              <select name="sparprod" id="sparprod" >

                <cfoutput query="related">

                  <option value="#related.sparprod#" <cfif (isDefined("rs_issue.sparprod") AND related.sparprod EQ rs_issue.sparprod)>selected="selected"</cfif>>#related.sparprod#</option>

                </cfoutput>

              </select>

       

      And the output in the dropdown box looks like

       

      PRODUCTS

      SPARES

      SPARES

       

       

      HOW can i have only ONE TIME Spares.

      I've got this problem with all my dynamic dropdown boxes.

       

       

      Thanks

      For your help in advance

      Klaas