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:

[WebDNA] Help me install (WebDNA 7 fastcgi install on Lion 10.7.3) (2012) Webstar 1.3.1 PPC (1997) [delete] problem (1997) Orders coming up blank (2004) restart needed???? (1997) Optimizing [founditems] (2000) [listfiles] nested in a [loop] (1998) HELLO (2000) Exclamation point (1997) still having search problem, please help :) (2004) Limitations on fields? Server is crashing (1997) 2nd WebCatalog2 Feature Request (1996) RE: How to verify email address (1997) The Form authentication trick (2000) [dos] command question (1997) [format 40s]text[/format] doesn't work (1997) Decrypting a user password (2000) [quantity] within formulas (1997) Re[3]: 2nd WebCatalog2 Feature Request (1996) A little syntax help (1997)