Instead of looping out the input, use QuotedValueList() function, thatputs 
the value into a comma delimited list and wraps each value inside single 
quotes, and then you use the IN SQL function.  So let's say for example, 1 
value was passed, QuotedValueList(a) would equal '343'.  if 3 values were 
passed, it would equal '343','323','43'.  and so on.

        <cfquery datasource="ITData">
                UPDATE
                        tblApplications
                set
                        InOut = 1
                WHERE
                        appID IN (#QuotedValueList(a)#)
        </cfquery>









>From: "Jones, Becky" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: CF-Talk <[EMAIL PROTECTED]>
>Subject: subtracting quantity
>Date: Wed, 29 Aug 2001 14:37:48 -0400
>
>i have a form for users to check out an application.  most of my
>applications are a quantity of 1, so once it is checked out, it will not
>show up in the drop down list of apps to check out until it is checked back
>in.  (i automatically set the checkout field to be yes).
>but for the few apps that have a quantity of greater than one, how can i
>make it so that it still shows up in the list until every single one has
>been checked out?
>right now my code just does this for every app checked out regardless of 
>the
>quantity
><cfloop list="#form.appID#" index="a" delimiters=",">
>       <cfquery datasource="ITData">
>               UPDATE
>                       tblApplications
>               set
>                       InOut = 1
>               WHERE
>                       appID = (#a#)
>       </cfquery>
>       </cfloop>
>
>
>*************************************************
>This e-mail, including any attachments, is intended for the
>receipt and use by the intended addressee(s), and may contain
>confidential and privileged information.  If you are not an intended
>recipient of this e-mail, you are hereby notified that any unauthorized
>use or distribution of this e-mail is strictly prohibited.
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to