Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is BETWEEN() as fast as greater or less than?
Message
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01505871
Message ID:
01505897
Views:
78
>>>I thought this syntax only works for SQL Server. Thank you.
>>>
>>>>The correct syntax is
>>>>
>>>>SELECT * FROM MyTable where  PK_FLD BETWEEN nLow AND nHigh
>>>>
>>>>
>>
>>It's because it works in SQL Server that it's the only syntax you should use. When you're righting SQL in VFP, use good SQL unless you have no choice. :)
>>
>>There is no speed difference. BETWEEN is converted.
>
>I am changing to use this syntax. Thank you.

BETWEEN and your original query are not the same, as BETWEEN is inclusive and your first query was border values exclusive.
As for the syntax, if you have syntax that works in both SQL Server and VFP, then always use the SQL Server compatible syntax

Field BETWEEN MinVal and MaxVal (MinVal and MaxVal will be included).
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform