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:

Reversing [ipaddress] normalization (1998) $Quit, $CloseDatabase corrections (1997) Summing fields (1997) snicker, snicker (1997) Re2: frames & carts (1997) WebCat2b13MacPlugIn - [shownext method=post] ??? (1997) vs (1997) won't [sendmail] inside of a [search] (2007) Need help with search title (1998) WebCat2 beta 11 - new prefs ... (1997) Formulas.db (2001) OT - asp snippet similar to [!][/!] (2003) PCS Frames (1997) WebCat2b13MacPlugin - nested [xxx] contexts (1997) Works! (1997) WCS Newbie question (1997) Bug or syntax error on my part? (1997) dbQuickView 2.0 (2005) WebCatalog can't find database (1997) Help formatting search results w/ table (1997)