Returns a TRUE value if each logical expression is TRUE.

Syntax

expression AND expression
expression
An expression that evaluates to a logical value (TRUE or FALSE).
Note: It is possible for an operand to evaluate to the Unknown value (?). For an AND operation, the result is FALSE if either operand evaluates to FALSE (even if one of the operands is the Unknown value (?)). In all other cases, the result is the Unknown value (?) if an operand evaluates to the Unknown value (?).

Example

This procedure lists all customers with credit limits between two values (supplied by the user and stored in the variables low-credit and hi-credit). The expressions Customer.CreditLimit >= low-credit and Customer.CreditLimit <= hi-credit are logical expressions because each yields a true or false value. Using the AND operator to join these logical expressions results in a logical expression that follows the WHERE keyword.

r-and.p

DEFINE VARIABLE low-credit LIKE credit-limit LABEL "Low Credit Limit".
DEFINE VARIABLE hi-credit  LIKE credit-limit LABEL "High Credit Limit".

REPEAT:
  SET low-credit hi-credit WITH FRAME cr-range.
  FOR EACH Customer NO-LOCK WHERE
    (Customer.CreditLimit >= low-credit) AND 
    (Customer.CreditLimit <= hi-credit):
    DISPLAY Customer.CustNum Customer.Name Customer.CreditLimit.
  END.
END.

See also

NOT operator (logical), OR operator (logical), Work with logical data