[ic] What is wrong with this numeric search?

Barry Treahy, Jr. interchange-users@icdevgroup.org
Fri Aug 23 15:13:01 2002


Ed LaFrance wrote:

> At 09:37 AM 08/23/2002 -0700, you wrote:
>
>> Can anyone please take a gander at this and tell me why it is not 
>> limiting the search to quantities less than 200?
>>
>> [loop
>>        prefix=FLY
>>        search="
>>                fi=tiers
>>                st=db
>>                tf=code
>>                co=yes
>>                rf=code,tier,quantity,discount,description
>>                ac=0
>>                sf=tier
>>                op=rm
>>                se=[scratch tier]
>>                nu=1
>>                sf=quantity
>>                op=<
>>                se=200
>> "]
>>
>> What it appears to be doing is showing me all quantities that begin 
>> with a character sort value less than two, so I'm seeing all 
>> quantities that begin with a 1 digit.  Below is also a sample of the 
>> said table:
>>
>> code    tier    quantity        description     discount
>> 00100   T1      1       1 to 9  1.00
>> 00110   T1      10      10 to 24        0.94
>> 00120   T1      25      25 to 49        0.89
>> 00130   T1      50      50 to 99        0.85
>> 00140   T1      100     100 to 199      0.78
>> 00150   T1      200     200 to 499      0.75
>> 00160   T1      500     500 to 999      0.71
>> 00170   T1      1000    1000 to 2499    0.66
>> 00180   T1      2500    2500 to 4999    0.62
>> 00190   T1      5000    5000 to 9999    0.57
>> 00200   T1      10000   10000 to 14999  0.52
>> 00210   T1      15000   15000 to 24999  0.49
>> 00220   T1      25000   25000 to 49999  0.46
>> 00230   T1      50000   50000 to 99999  0.43
>> 00240   T1      100000  100000 +        0.40
>>
>> I'm sure this is a case of too much coffee and too little sleep, but 
>> I've got a deadline at the end of this month of goofy things like 
>> this are driving me nuts... It seems is the simple stuff I'm really 
>> getting screwed up on...  Anyone?
>>
>> Barry
>
>
> The way this search is written, I think that nu=1 is being interpreted 
> to apply to the field 'tier' instead of 'quantity'. You can just 
> change that one to nu=0, then add nu=1 to the bottom of the search 
> terms. Give that a try, or switch to search option arrays:
>
> http://www.icdevgroup.org/cgi-bin/ic/docfly.html?mv_arg=icdatabase06.04
>
> - Ed L.


Gezz....  Thank you Ed, by simply assuring that with the coordinated 
search I kept the same number of arguments for each key, it worked just 
fine...  I didn't even need to try the array approach.  Arg, so much 
wasted time!  Thanks again!

Barry

-- 

Barry Treahy, Jr  *  Midwest Microwave  *  Vice President & CIO 

E-mail: Treahy@mmaz.com * Phone: 480/314-1320 * FAX: 480/661-7028