Re: Sorting by multiple fields

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 52071
interpreted = N
texte = Can you modify your database by adding a "MaxScore" field where you store the highest of the two scores? Then you could sort on that. There is no simple way to do this with WebDNA, though there are always workarounds. If you can't modify the source database, you could load your results into a table (if 5.0 or greater) or create a temporary DB and include the "MaxScore" field there for sorting. This reminds me... it would sure be nice if the [math] context supported max() and min() functions. Saying [math]max([hometeam],[awayteam])[/math] would be much nicer to my eyes than [if [hometeam]>[awayteam]][then][hometeam][/then][else][awayteam][/else][/ if] - brian On Tuesday, August 5, 2003, at 04:19 PM, Justin Carroll wrote: > Gary, > > Thanks for the info. What I'm really wanting to do is show the highest > score of the team that won down to the lowest score of the team that > won. > Like this: > > Blue Team 50 > Red Team 22 > > Green Team 40 > Yellow Team 26 > > Black Team 30 > Orange Team 7 > > See what I'm saying? Let me know, thanks. > > Justin Carroll > > ----- Original Message ----- > From: "Gary Krockover" > To: "WebDNA Talk" > Sent: Tuesday, August 05, 2003 5:10 PM > Subject: Re: Sorting by multiple fields > > >> You can sort it after you've returned your search results such as: >> >> [search db=game.db&geskudatarq=0&additional sorting (by date for >> example)...] >> [founditems] >> [showif [hometeam]>[awayteam]] >> Home: [hometeam] Away: [awayteam]
>> [/showif] >> [showif [awayteam]>[hometeam]] >> Away: [awayteam] Home: [hometeam]
>> [/showif] >> [/founditems] >> [/search] >> >> Not sure if that will help you or not though.... >> >> GK >> >> >> >> -----Original Message----- >> From: WebDNA Talk [mailto:WebDNA-Talk@talk.smithmicro.com]On Behalf Of >> Justin Carroll >> Sent: Tuesday, August 05, 2003 3:52 PM >> To: WebDNA Talk >> Subject: Sorting by multiple fields >> >> >> I'd like to know how to sort my search for the greater of two numeric >> fields. The db may look something like this: >> >> sku hometeam awayteam >> 1 40 22 >> >> The search would go [search db=game.db&geskudatarq=0&(what goes >> here?)]. >> It's how to sort by the greater of "hometeam" and "awayteam" that I >> don't >> get. Thanks. >> >> Justin Carroll > -- Brian Fries, BrainScan Software -- http://www.brainscansoftware.com -- ------------------------------------------------------------- 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://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Sorting by multiple fields ( Brian Fries 2003)
  2. Re: Sorting by multiple fields ( "Justin Carroll" 2003)
  3. Re: Sorting by multiple fields ( "Gary Krockover" 2003)
  4. Sorting by multiple fields ( Justin Carroll 2003)
Can you modify your database by adding a "MaxScore" field where you store the highest of the two scores? Then you could sort on that. There is no simple way to do this with WebDNA, though there are always workarounds. If you can't modify the source database, you could load your results into a table (if 5.0 or greater) or create a temporary DB and include the "MaxScore" field there for sorting. This reminds me... it would sure be nice if the [math] context supported max() and min() functions. Saying [math]max([hometeam],[awayteam])[/math] would be much nicer to my eyes than [if [hometeam]>[awayteam]][then][hometeam][/then][else][awayteam][/else][/ if] - brian On Tuesday, August 5, 2003, at 04:19 PM, Justin Carroll wrote: > Gary, > > Thanks for the info. What I'm really wanting to do is show the highest > score of the team that won down to the lowest score of the team that > won. > Like this: > > Blue Team 50 > Red Team 22 > > Green Team 40 > Yellow Team 26 > > Black Team 30 > Orange Team 7 > > See what I'm saying? Let me know, thanks. > > Justin Carroll > > ----- Original Message ----- > From: "Gary Krockover" > To: "WebDNA Talk" > Sent: Tuesday, August 05, 2003 5:10 PM > Subject: Re: Sorting by multiple fields > > >> You can sort it after you've returned your search results such as: >> >> [search db=game.db&geskudatarq=0&additional sorting (by date for >> example)...] >> [founditems] >> [showif [hometeam]>[awayteam]] >> Home: [hometeam] Away: [awayteam]
>> [/showif] >> [showif [awayteam]>[hometeam]] >> Away: [awayteam] Home: [hometeam]
>> [/showif] >> [/founditems] >> [/search] >> >> Not sure if that will help you or not though.... >> >> GK >> >> >> >> -----Original Message----- >> From: WebDNA Talk [mailto:WebDNA-Talk@talk.smithmicro.com]On Behalf Of >> Justin Carroll >> Sent: Tuesday, August 05, 2003 3:52 PM >> To: WebDNA Talk >> Subject: Sorting by multiple fields >> >> >> I'd like to know how to sort my search for the greater of two numeric >> fields. The db may look something like this: >> >> sku hometeam awayteam >> 1 40 22 >> >> The search would go [search db=game.db&geskudatarq=0&(what goes >> here?)]. >> It's how to sort by the greater of "hometeam" and "awayteam" that I >> don't >> get. Thanks. >> >> Justin Carroll > -- Brian Fries, BrainScan Software -- http://www.brainscansoftware.com -- ------------------------------------------------------------- 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://webdna.smithmicro.com/ Brian Fries

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:

Error: Too many nested [xxx] contexts (1997) Extracting a filename (2004) cc auth with [purchase] (1998) WebCat2 Append problem (B14Macacgi) (1997) HomePage Caution (1997) POP Mail Server Reseting (1998) WebCatalog 2.0 & WebDNA docs in HTML ... (1997) how to include a name in from or to using Sendmail? (2003) [WebDNA] Donation - Mobile devise (2017) Search design (1997) Blocking off access (2005) [append] (1997) WebStar Secure on other machine (1997) Summing results of a nested search (2006) WC1.6 to WC2 date formatting -FIXED! (1997) [WriteFile] problems (1997) WebCatalog not recognizing ShoppingCarts folder (2000) plugin-acgi, different results (1997) WebCatalog 4.0.2b5 available (2000) Database not found in Include (2002)