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:

Emailer Set Up (1997) Writefile outside WebSTAR hierarchy? (1997) Using WC for Bulk Emailings (1997) WebCat2 beta 11 - new prefs ... (1997) Configuring E-mail (1997) Extended [ConvertChars] (1997) Help name our technology! (1997) Where do you put files? (2000) include bug????? (1997) PCS Frames (1997) No more misunderstanding ... yay! :) (1997) E-Mail Preferences in Admin Folder (1997) WebCatalog 4.0.1b1 is now available (2000) [SHOWIF AND/OR] (1997) Simple Store (2000) ConverChars (1999) [url] (1997) any suggestions for creating a multi-lingual site? (1999) WebCat2b12 - nesting [tags] (1997) multi-paragraph fields (1997)