Re: Finding max value for a field

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 13368
interpreted = N
texte = >I want to generate a sequential series of ID numbers for database >records (I have to do this separately from the [cart] function). > >Is there an easy way to quickly look up the maximum value in a >particular field for all database records? I can then use [math] to make >the next number. Here, try this:[append db=database.db]particularfield=[search db=database.db&neparticularfielddata=0&desortparticularfield=1&max=1][founditems ][math][particularfield]+1[/math][/founditems][/search][/append]Sincerely, Ken Grome WebDNA Solutions http://www.hui.net/dna/webdna.html Associated Messages, from the most recent to the oldest:

    
  1. Re: Finding max value for a field (Pat McCormick 1997)
  2. Re: Finding max value for a field (Kenneth Grome 1997)
  3. Re: Finding max value for a field (Kenneth Grome 1997)
  4. Re:Finding max value for a field (Jay Van Vark 1997)
  5. Finding max value for a field (Pat McCormick 1997)
>I want to generate a sequential series of ID numbers for database >records (I have to do this separately from the [cart] function). > >Is there an easy way to quickly look up the maximum value in a >particular field for all database records? I can then use [math] to make >the next number. Here, try this:[append db=database.db]particularfield=[search db=database.db&neparticularfielddata=0&desortparticularfield=1&max=1][founditems ][math][particularfield]+1[/math][/founditems][/search][/append]Sincerely, Ken Grome WebDNA Solutions http://www.hui.net/dna/webdna.html Kenneth Grome

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:

all records returned. (1997) Listserver problem (1997) [isfile] ? (1997) [WebDNA] multi-language sites in current versions of webdna? (2010) Configuration Q (1998) [purgeDatabase], [replaceChars] and others ... (1997) Protect vs Authenicate (1997) Record size (1998) multiple product databases (1997) WebMechant (2000) HideIf ip= OR ip (1998) Help! (2000) [searh] or [shownext]problem (1998) What date is it anyway? (2004) Small problem (2001) WebCatalog 2.0 & WebDNA docs in HTML ... (1997) OT: Limit on # of Pulldown entries (1997) sku, title, price not showing up (1998) WebMerchant 1.6 and SHTML (1997) the dreaded unitShipCost (2003)