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]- brianOn 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:
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]- brianOn 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:
[listfiles] with max? (2000)
WC2b12: Yes, Formulas.db is for real (1997)
Multiple results (2001)
Include a big block of text (1997)
[BULK] [WebDNA] Authorize.net SIM, Server Integration Method (2011)
A little syntax help (1997)
Subtotal Not Calculated on Invoice.html (1998)
do you have a webcatalog tool you want to sell? (1999)
[/application] error? (1997)
shipcost (1997)
NT BETA BUG???? (1997)
BGcolor (1997)
Up and running ... at last !! (1997)
[WebDNA] "Technical Reference" link broken in admin (2013)
(More) Question about searching combination of fields (2003)
Help name our technology! I found it (1997)
[replaceChars] would be nice ... (1997)
Re:2nd WebCatalog2 Feature Request (1996)
vs (1997)
Refresh cart# (1999)