Re: Summing fields in a search/founditems context??
This WebDNA talk-list message is from 2000
It keeps the original formatting.
numero = 36383
interpreted = N
texte = on 8/21/00 10:07 PM, Robert McPeak at robertmcpeak@hotmail.com wrote:> Would one of you whiz kids let me in on how to get a sum total of a> particular field in a founditems set.> > Let's say I've got a db with two fields, name and age. I want to do a> search for all unique names, and then add up all the ages to yield a total> age result.> > Bob 10> Joe 12> Nancy 13> > Total Age: 35> > Help??!If you're using 4.0 you can use the below context.New in 4.0[Sum field=fieldName] Calculates the numerical sum of all thefound records, using the fieldName column.Or create a math var outside the founditems loop and increment it by the agein the found items loop.[math show=F]agevar=[agevar]+[age][/math]-Jason Tylerwww.3ip.net-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list
.To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/
Associated Messages, from the most recent to the oldest:
on 8/21/00 10:07 PM, Robert McPeak at robertmcpeak@hotmail.com wrote:> Would one of you whiz kids let me in on how to get a sum total of a> particular field in a founditems set.> > Let's say I've got a db with two fields, name and age. I want to do a> search for all unique names, and then add up all the ages to yield a total> age result.> > Bob 10> Joe 12> Nancy 13> > Total Age: 35> > Help??!If you're using 4.0 you can use the below context.New in 4.0[Sum field=fieldName] Calculates the numerical sum of all thefound records, using the fieldName column.Or create a math var outside the founditems loop and increment it by the agein the found items loop.[math show=F]agevar=[agevar]+[age][/math]-Jason Tylerwww.3ip.net-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/
Jason Tyler
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:
Writing files (2000)
Summing fields (1997)
Date math (1997)
locking variables? (2000)
duplicate cart numbers (2002)
Inventory Adjustment (2000)
[WebDNA] fastcgi 7+ & [cart]? (2010)
Searching for foreign chars (2004)
WebDNA-Talk Digest mode broken (1997)
Sendmail Context (2003)
Not Enough Memory for Database? (2003)
Linked lists and Recursive searching (2003)
WebCat2: multiple currency support (1997)
did I miss anything (1997)
Filemaker Pro Template for Orders (1999)
HTML encoding in URLs (1997)
Submitting ampersands in forms... (1998)
SMTP Mail Server (2003)
Locking up with WebCatalog... (1997)
webcatalog [date] bug (1999)