do a "set InOut = InOut - 1" instead of what you have - this will subtract
one from InOut in the database each time the query is called (and it will
keep going into negative territory if you're not careful)

When you want to add to InOut (i.e. when it's checked back in) change the
'-' to a '+'.

-----Original Message-----
From: Jones, Becky [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 29, 2001 2:38 PM
To: CF-Talk
Subject: subtracting quantity


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