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:

Optional new-style syntax for WebCatalog 4.0 (2000) WebCat2b12 - nesting [tags] (1997) Nested [tags] (2001) WebCat (or other) Indexing (1999) 1st Comparison inside [fileinfo] broken. = bug? (2004) Extended [ConvertChars] (1997) Multiple prices (1997) Mac app. that converts e-mails (2000) WebCat2: multiple currency support (1997) problems with 2 tags shakur (1997) international time (1997) Include Files (1998) [subtotal] problems -- help? (1998) Where is the secure setting for text variables? (2003) More on the email templates (1997) Cancel Subscription (1996) type 2 errors with ssl server (1997) shownext (1997) Emailer not working (1998) form validator issue (2005)