Re: Generating Report Totals

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 11182
interpreted = N
texte = Dan L Gilpin wrote:> I must be too tired, but I don't see in the sparse documentation how to > generate a total following a search. I just want to present a list of > found items, each with a numeric field, and have a total after the last > item. I hope a shopping cart is not required, as these lists are simple > searches of a database. Just point me in the right direction. > > Thanks.No, it's not in the docs, but that's what we have people like Ken on the list for. The trick is to wrap the numeric field in a [FoundItems] loop with a little [math] thrown in:Total purchases to date: $[format 5.2f][search db=XXX.db&nedatedata=0][math][founditems][NumericField]+[/founditems]0[/math][/search][/format]The zero at the end is required for some reason I can't recall at the moment.-- Gil Poulsen, Webmaster************************************************************** * AltiM@c * Phone: (908) 469-2567 * * 126 Jerome Avenue * FAX: (908) 469-5823 * * South Bound Brook, NJ * e-mail: help@altimac.com * * 08880-1111 * WWW: http://www.altimac.com * ************************************************************** Associated Messages, from the most recent to the oldest:

    
  1. Re: Generating Report Totals (Kenneth Grome 1997)
  2. Re: Generating Report Totals (Grant Hulbert 1997)
  3. Re: Generating Report Totals (Dan Gilpin 1997)
  4. Re: Generating Report Totals (Gil Poulsen 1997)
  5. Generating Report Totals (Dan L Gilpin 1997)
Dan L Gilpin wrote:> I must be too tired, but I don't see in the sparse documentation how to > generate a total following a search. I just want to present a list of > found items, each with a numeric field, and have a total after the last > item. I hope a shopping cart is not required, as these lists are simple > searches of a database. Just point me in the right direction. > > Thanks.No, it's not in the docs, but that's what we have people like Ken on the list for. The trick is to wrap the numeric field in a [founditems] loop with a little [math] thrown in:Total purchases to date: $[format 5.2f][search db=XXX.db&nedatedata=0][math][founditems][NumericField]+[/founditems]0[/math][/search][/format]The zero at the end is required for some reason I can't recall at the moment.-- Gil Poulsen, Webmaster************************************************************** * AltiM@c * Phone: (908) 469-2567 * * 126 Jerome Avenue * FAX: (908) 469-5823 * * South Bound Brook, NJ * e-mail: help@altimac.com * * 08880-1111 * WWW: http://www.altimac.com * ************************************************************** Gil Poulsen

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Strange ThisURL under Linux (2000) SSL problems (1998) Links and Carriage Returns, Oh my! (2000) Random sort is not random at all..... (2000) Surprise x and y post args (1998) DB Field Name? (2000) Setting up the server (1997) [WebDNA] Format Days_To_Date (2008) ShowNext Context (2004) Confused about QTY and QTY* price updating (1998) WC 2.0 frames feature (1997) Up-date for Webcatalog 2.0 (1998) serial number generation (1997) Feature req. (2002) searching by date range help needed (1997) Protect vs Authenicate (1997) Public beta 6 for WebCatalog 4.0 is now available (2000) Date Question (2002) [OT] .php3 extension (2000) Still Pulling my hair out (2001)