Re: BUG REPORT: numeric ge, le, gr & ls comparisons don't work...

This WebDNA talk-list message is from

1999


It keeps the original formatting.
numero = 22305
interpreted = N
texte = This is not a bug, and in fact works as designed. Remember that something like leHIGHdatarq=35 means find all values in the database whose low field is greater than or equal to 35. Since both of your comparisons have rq at the end, thus making them required, you are essentially asking (in the first example) to find all values which are BOTH low>=35 AND high<=35, which is a numeric impossibility with your data set.>Using numeric ge, le, gr & ls comparisons in a search context fail, but >using the opposite comparison gives the correct results when it should >fail. This means webcat is working just the opposite of how it should >work. Try it for yourself with the following test.db and test.tpl page and >you'll see what I mean ... > >Test.db: > >low high >1 100 >30 300 >50 500 > >Test.tpl: > > >[search >db=test.db&gelowdatarq=[value]&lehighdatarq=[value]&lowtype=num&hightype=num]Cor >rect Code finds [numfound] >matches:
[founditems][low]-[high]
[/founditems][/search]

>[search >db=test.db&lelowdatarq=[value]&gehighdatarq=[value]&lowtype=num&hightype=num]Inc >orrect Code finds [numfound] >matches:
[founditems][low]-[high]
[/founditems][/search] >

Done.Technical Support | ==== eCommerce and Beyond ==== Pacific Coast Software | WebCatalog, WebMerchant, 11770 Bernardo Plaza Court | SiteEdit Pro, PhotoMaster, San Diego, CA 92128 | Typhoon 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: BUG REPORT: numeric ge, le, gr & ls comparisons don't work ... (PCS Technical Support 1999)
  2. Re: BUG REPORT: numeric ge, le, gr & ls comparisons don't work ... (PCS Technical Support 1999)
  3. Re: BUG REPORT: numeric ge, le, gr & ls comparisons don't work (Brian B. Burton 1999)
  4. Re: BUG REPORT: numeric ge, le, gr & ls comparisons don't work ... (Kenneth Grome 1999)
  5. Re: BUG REPORT: numeric ge, le, gr & ls comparisons don't work... (PCS Technical Support 1999)
  6. BUG REPORT: numeric ge, le, gr & ls comparisons don't work ... (Kenneth Grome 1999)
This is not a bug, and in fact works as designed. Remember that something like leHIGHdatarq=35 means find all values in the database whose low field is greater than or equal to 35. Since both of your comparisons have rq at the end, thus making them required, you are essentially asking (in the first example) to find all values which are BOTH low>=35 AND high<=35, which is a numeric impossibility with your data set.>Using numeric ge, le, gr & ls comparisons in a search context fail, but >using the opposite comparison gives the correct results when it should >fail. This means webcat is working just the opposite of how it should >work. Try it for yourself with the following test.db and test.tpl page and >you'll see what I mean ... > >Test.db: > >low high >1 100 >30 300 >50 500 > >Test.tpl: > > >[search >db=test.db&gelowdatarq=[value]&lehighdatarq=[value]&lowtype=num&hightype=num]Cor >rect Code finds [numfound] >matches:
[founditems][low]-[high]
[/founditems][/search]

>[search >db=test.db&lelowdatarq=[value]&gehighdatarq=[value]&lowtype=num&hightype=num]Inc >orrect Code finds [numfound] >matches:
[founditems][low]-[high]
[/founditems][/search] >

Done.Technical Support | ==== eCommerce and Beyond ==== Pacific Coast Software | WebCatalog, WebMerchant, 11770 Bernardo Plaza Court | SiteEdit Pro, PhotoMaster, San Diego, CA 92128 | Typhoon 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com/ PCS Technical Support

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:

show all problem (1997) On a related topic (2006) cookies and [returnraw] (1997) webcatalog loosing serial number (1998) [WebDNA] 2 cookies, same name different value (2016) Cookies not setting on IE (2002) PCS Customer submissions ? (1997) (1997) Database Strategy - more... (1998) WebCommerce: Folder organization ? (1997) old cart file deletion (2000) Ok here is a question? (1997) Cannot calculate prices (1997) Maybe off topic but how to charge (1997) Emailer again & again (1997) Checkboxes (1998) FormVariable (1999) showif comparison begins w/ and contains (1997) [WebDNA] setting up a dev server on Windows 7 or 8? (2014) Buying sans cart (1997)