Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8587429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:34:02+00:00 2026-06-11T22:34:02+00:00

I have the following code: <cfif SideSell neq > <cftry> <cfif listlen(SideSell, ,) gt

  • 0

I have the following code:

<cfif SideSell neq "">
    <cftry>
        <cfif listlen(SideSell, ",") gt 0>
            <cfset sidesellvalid = true>
            <cfelse>
            <cfset sidesellvalid = false>
        </cfif>
        <cfcatch type="any">
            <cfset sidesellvalid = false>
        </cfcatch>
    </cftry>
    <cfif sidesellvalid>
        <cfset AddPartNumber = "">
        <cfset AddDescription = "">
        <cfset AddQuantity = "">
        <cfset AddPrice = "">
        <cfset OptionPrice = "">
        <cfset AddItem = "">
        <cfloop list="FORM.SideSell" index="SideSellListIndex" delimiters=",">
            <cfquery name="qSideSellParts" datasource="Pascal">
                SELECT * from Part WHERE PartNumber = <cfqueryparam cfsqltype="cf_sql_varchar" list="yes" separator="," maxlength="45" value="#ListGetAt(SideSell, SideSellListIndex, ',')#">
            </cfquery>
            <cfset AddPartNumber = "#qSideSellParts.PartNumber#">
            <cfset AddDescription = "#qSideSellParts.SubCategory#">
            <cfset AddQuantity = "1">
            <cfset AddPrice = "#qSideSellParts.PartPrice1#">
            <cfset OptionPrice = "0">
            <cfset AddItem = "Add To Cart">

            <cfinclude template="checkpart.cfm">
        </cfloop>
    </cfif>
</cfif>

However, CF is throwing a typecasting exception, saying

“The value FORM.SideSell cannot be converted to a number.”

at the SQL line:

SELECT * from Part WHERE PartNumber = <cfqueryparam cfsqltype="cf_sql_varchar" list="yes" separator="," maxlength="45" value="#ListGetAt(SideSell, SideSellListIndex, ',')#">

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?

EDIT: Running CF9 on my testing server, CF8 on production server. I used a <cfdump> tag to verify the data is what I expected, and it is.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T22:34:03+00:00Added an answer on June 11, 2026 at 10:34 pm

    You’re misunderstanding how cfloop works with the list attribute – you don’t need ListGetAt since the value is contained in the index.

    (Technically this isn’t accurate – it should be item because that’s what you’re getting, but whoever originally implemented cfloop did it this way and we’ve been stuck with it.)

    Also note that list must be a string – not a variable name – so you need hashes to evaluate the variable to one.

    Finally since you’re looping through your list one item at a time, you should not use the list attribute of cfqueryparam – (this is for when you are doing WHERE PartNumber IN (x,y,z) style queries and want the parameter treated as multiple values.)

    In summary, your loop should look like this.

    <cfloop list=#Form.SideSell# index="PartNumber">
        <cfquery name="qSideSellParts" datasource="Pascal">
            SELECT * from Part
            WHERE PartNumber = <cfqueryparam cfsqltype="cf_sql_varchar" value="#PartNumber#">
        </cfquery>
        ...
    </cfloop>
    

    (If you don’t understand why, add a comment and I’ll try to explain further.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following code and it returns false for @B LIKE @A comparison in
I have following code: mCommandMap[command.pId] = new System.Threading.ManualResetEvent(false); SendCommandASync(command); mCommandMap[command.pId].WaitOne(); Where mCommandMap is a
I have following code in VS2008 If Linq.Enumerable.Contains(Of String)(selectedUsersRoles, RoleCheckBox.Text) Then RoleCheckBox.Checked = True
I have following code: div.accountPage div.acct-form.login div.acct-header Log-in form.loginForm.login input(id=username, type=text, name=User, placeholder=Username, value=)
I have following code: INPUT Input = { 0 }; Input.type = INPUT_KEYBOARD; Input.mi.dwFlags
I have following code: package main import ( fmt ) type Point struct {
I have following code: hotels = models.Hotel.objects.filter( wed=True, county=hotel_main.county.id, subscriptions__end_date__gte=datetime.date.today(), subscriptions__enquiry_count__lte=F('subscriptions__tier__enquiry_limit'), ).filter(Q(x=TRUE|Q(y=True)).distinct() And i
I have following code in initialization im = imread('Image02.tif'); figure(); imagesc(im); colormap(gray); [hImage hfig
I have following code <div id=main> <div id=one> </div> <div id=two> </div> <div id=three>
I have following code for updating user's column public void UpdateLastModifiedDate(string username) { using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.