Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Newbie at select statements
Message
From
02/11/2000 09:18:51
 
 
To
01/11/2000 17:07:35
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00436920
Message ID:
00437085
Views:
17
>>I can't figure out why these two select statements give me different results. The only difference is the where clause.
>>
>>select sum(scordln.orl_qty-scordln.orl_qtyinvoiced) as nqty ;
>>from scordln left outer join scorder ;
>>on scordln.orl_order = scorder.ord_order ;
>>where between(scorder.ord_acct,1,201) ;
>>into cursor cqty
>>
>>select sum(scordln.orl_qty-scordln.orl_qtyinvoiced) as nqty ;
>>from scordln left outer join scorder ;
>>on scordln.orl_order = scorder.ord_order ;
>>where scorder.ord_acct < 201 ;
>>into cursor cqty
>>
>>Thanks
>>
>>Pat Murphy
>
>The between() in the first gets between 1 and 201 *inclusively*
>The second excludes 201.
>The make them the same either change the first to
>where between(scorder.ord_acct,1,200)
>or the second to
>where scorder.ord_acct <= 201

The second is that the < operator includes 0 or negative values that might exists; 0, which could be a default for a null or empty assignment, might be a significant factor.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform