title: ListGetAt function returns type conversion error
body: <p>I have the following code:</p>
  
  <pre><code>&lt;cfif SideSell neq ""&gt;
      &lt;cftry&gt;
          &lt;cfif listlen(SideSell, ",") gt 0&gt;
              &lt;cfset sidesellvalid = true&gt;
              &lt;cfelse&gt;
              &lt;cfset sidesellvalid = false&gt;
          &lt;/cfif&gt;
          &lt;cfcatch type="any"&gt;
              &lt;cfset sidesellvalid = false&gt;
          &lt;/cfcatch&gt;
      &lt;/cftry&gt;
      &lt;cfif sidesellvalid&gt;
          &lt;cfset AddPartNumber = ""&gt;
          &lt;cfset AddDescription = ""&gt;
          &lt;cfset AddQuantity = ""&gt;
          &lt;cfset AddPrice = ""&gt;
          &lt;cfset OptionPrice = ""&gt;
          &lt;cfset AddItem = ""&gt;
          &lt;cfloop list="FORM.SideSell" index="SideSellListIndex" delimiters=","&gt;
              &lt;cfquery name="qSideSellParts" datasource="Pascal"&gt;
                  SELECT * from Part WHERE PartNumber = &lt;cfqueryparam cfsqltype="cf_sql_varchar" list="yes" separator="," maxlength="45" value="#ListGetAt(SideSell, SideSellListIndex, ',')#"&gt;
              &lt;/cfquery&gt;
              &lt;cfset AddPartNumber = "#qSideSellParts.PartNumber#"&gt;
              &lt;cfset AddDescription = "#qSideSellParts.SubCategory#"&gt;
              &lt;cfset AddQuantity = "1"&gt;
              &lt;cfset AddPrice = "#qSideSellParts.PartPrice1#"&gt;
              &lt;cfset OptionPrice = "0"&gt;
              &lt;cfset AddItem = "Add To Cart"&gt;
  
              &lt;cfinclude template="checkpart.cfm"&gt;
          &lt;/cfloop&gt;
      &lt;/cfif&gt;
  &lt;/cfif&gt;
  </code></pre>
  
  <p>However, CF is throwing a typecasting exception, saying</p>
  
  <blockquote>
    <p>"The value FORM.SideSell cannot be converted to a number."</p>
  </blockquote>
  
  <p>at the SQL line:</p>
  
  <pre><code>SELECT * from Part WHERE PartNumber = &lt;cfqueryparam cfsqltype="cf_sql_varchar" list="yes" separator="," maxlength="45" value="#ListGetAt(SideSell, SideSellListIndex, ',')#"&gt;
  </code></pre>
  
  <p>The test data I have tried includes "PTI 19-1" and "PTI 19-1,PTI 19-2" so the problem exists regardless of the list item count. Am I simply missing or misusing a quote mark? </p>
  
  <p>EDIT: Running CF9 on my testing server, CF8 on production server. I used a <code>&lt;cfdump&gt;</code> tag to verify the data is what I expected, and it is.</p>