Just incase the noobie misses the mistake.

<cfset total = 0 />
<cfoutput ... >
  <cfset total = total + order_value />
  ...
</cfoutput>
..... TOTAL <cfoutput>#total#</cfoutput>

cheers,
barneyb

We still need those variables to be inside cfoutput sets, don't we.  :-)

--------------
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA
 
"C code. C code run. Run code run. Please!"
- Cynthia Dunning

....-----Original Message-----
....From: Barney Boisvert [mailto:[EMAIL PROTECTED]
....Sent: Thursday, July 07, 2005 3:40 PM
....To: CF-Talk
....Subject: Re: Noob: getting a total from some CFOUTPUTted fields
....
....<cfset total = 0 />
....<cfoutput ... >
....  <cfset total = total + order_value />
....  ...
....</cfoutput>
........ TOTAL #total#
....
....cheers,
....barneyb
....
....On 7/7/05, Chris Kavanagh <[EMAIL PROTECTED]> wrote:
....> Hey list!
....>
....> How's it going?  My first app is running now.  I couldn't have done
....> it without everybody's help!  Thanks to all.  Perhaps I will
....> eventually become a useful member myself.
....>
....> Now, in my app I have a CFOUTPUT that displays table rows like this:
....>
....> CUSTOMER      PRODUCT      ORDER VALUE
....> #customer#        #product#        #order_value#
....>
....> I'd like to have a TOTAL field at the bottom of the table, that
....> displays the sum of all the CFOUTPUTted #order_values#.  Is this very
....> difficult?
....>
....> This is what I'd like to see:
....>
....> CUSTOMER        PRODUCT        ORDER VALUE
....> Tom                       Apple                  100
....> Dick                       Banana              200
....>                                                             ------
....>                                               TOTAL 300
....>
....> How do I calculate the total?
....>
....> Thanks in advance,
....> CK.
....
....
....--
....Barney Boisvert
[EMAIL PROTECTED]
....360.319.6145
....http://www.barneyb.com/
....
....Got Gmail? I have 50 invites.
....
....

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:211392
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to