Re: Sorting Results

This WebDNA talk-list message is from

1999


It keeps the original formatting.
numero = 23465
interpreted = N
texte = I believe your code is correct except it thinks what you are sorting is text not numbers. I included the related page from the docs (found under Search/numbers) below.I hope it help.RH Prouty bristol> I am having problems sorting results. The number 100 is listing below 99, > 98 ... > > Is there a formatting error in my search? > > [search db=[sku].db&eqnamedata=t&bidsort=1&bidsdir=de&max=3] > > Thanks, > > Arthur > http://www.educorp.comxxxxxxxxxx Docs xxxxxxxxxxxxSearching - Numbers FieldNametype=numWebCatalog normally compares all fields in a database as though they were text, even if they look like numbers to you. Unless you tell it to compare a field numerically (or as a date), all comparisons are alphabetical. If your database has a numeric field (Price, for instance) that you wish to compare numerically, you would put something like the following in the search criteria:http://Results.tpl?command=search&gePricedata=99.95&Pricetype=num Why is this important? Imagine that WebCatalog is comparing two text fields that happen to contain numbers in them: Compare 10.95 to 9.95 -- when compared alphabetically, WebCatalog looks at the first letter in both fields and sees 1 and 9, respectively. In this case, it would (wrongly) assume that 9 is greater than 1 (which in an alphabetical sense is true), and would sort 9.95 after 10.95. This is probably not what you meant.When compared numerically, the two numbers would sort correctly. Associated Messages, from the most recent to the oldest:

    
  1. Re: Sorting Results (Howard Wolosky 1999)
  2. Re: Sorting Results (RH Prouty 1999)
  3. Re: Sorting Results (Arthur Frischman 1999)
  4. Re: Sorting Results (PCS Technical Support 1999)
  5. Sorting Results (Arthur Frischman 1999)
I believe your code is correct except it thinks what you are sorting is text not numbers. I included the related page from the docs (found under Search/numbers) below.I hope it help.RH Prouty bristol> I am having problems sorting results. The number 100 is listing below 99, > 98 ... > > Is there a formatting error in my search? > > [search db=[sku].db&eqnamedata=t&bidsort=1&bidsdir=de&max=3] > > Thanks, > > Arthur > http://www.educorp.comxxxxxxxxxx Docs xxxxxxxxxxxxSearching - Numbers FieldNametype=numWebCatalog normally compares all fields in a database as though they were text, even if they look like numbers to you. Unless you tell it to compare a field numerically (or as a date), all comparisons are alphabetical. If your database has a numeric field (Price, for instance) that you wish to compare numerically, you would put something like the following in the search criteria:http://Results.tpl?command=search&gePricedata=99.95&Pricetype=num Why is this important? Imagine that WebCatalog is comparing two text fields that happen to contain numbers in them: Compare 10.95 to 9.95 -- when compared alphabetically, WebCatalog looks at the first letter in both fields and sees 1 and 9, respectively. In this case, it would (wrongly) assume that 9 is greater than 1 (which in an alphabetical sense is true), and would sort 9.95 after 10.95. This is probably not what you meant.When compared numerically, the two numbers would sort correctly. RH Prouty

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:

Comments in db? (1997) Base64 encryption limitations? (1999) problems with 2 tags (1997) interesting Unix bug (2000) [WebDNA] To Flush, to commit or to...? (2014) [Announce]: Web server security and password protection (1997) [WebDNA] lookup in tables defined in functions - bug? (2016) using showpage and showcart commands (1996) [TaxableTotal] - not working with AOL and IE (1997) WebCat consulting $ (1998) What if SSL server down? MAC (1997) A quickie question (1997) Great product and great job ! (1997) WebCatalog 3.0.8 Mac OS (2000) WebCatalog NT beta 18 now available (1997) Shopping carts and reloading pages (1997) Webcat2, WebCommerce, Mod 10 etc. (1997) addlineitem mystery (2003) Repeating Fields (1997) Still online from NY (2003)