BETWEEN( ) Function

Determines whether the value of an expression is inclusively between the values of two expressions of the same type.

BETWEEN(eTestValue, eLowValue, eHighValue)

Parameters

  • eTestValue
    Specifies an expression to evaluate.

  • eLowValue
    Specifies the lower value in the range.

  • eHighValue
    Specifies the upper value in the range.

Return Value

Logical or null. BETWEEN( ) returns True (.T.) if the value of the specified expression is equal to one of the values or greater than the lower value and less than the higher value of the two expressions. Otherwise, BETWEEN( ) returns False (.F.). BETWEEN( ) returns a null value if eLowValue or eHighValue is a null value.

Example

The following example scans the orders table for all records in the order_amt field with values between 950 and 1000 inclusive and displays the cust_id field and the order_amt field.

CLOSE DATABASES
OPEN DATABASE (HOME(2) + 'Data\testdata')
USE orders  && Open order table

CLEAR
SCAN FOR BETWEEN(order_amt,950,1000)
   ? cust_id, order_amt
ENDSCAN

See Also

Reference

MAX( ) Function

MIN( ) Function

Other Resources

Functions

Language Reference (Visual FoxPro)