and Logical Operator

The and logical operator indicates that both components of a logical expression must be true.

Syntax

exp and exp

Synonym(s)

&

Example(s)

The expression tax = 0 and value > 0 is true when tax equals 0 and value is greater than 0.

if tax = 0 and value > 0 then...

The expression counter > max and value > 10 and y < 100 requires that all three logical expressions to be true for the complete expression to be true.

if counter > max and value > 10 and y < 100 then...

You can use the single attribute specification form of the and logical operator to optimize your queries. For example, when a numeric index on date is present, the expression:

select invoice with date > "feb 1 2013" and <= "feb 28 2013"

[4041] 183914 items selected.

should run significantly faster than the multiple attribute specification form of the expression:

select invoice with date > "feb 1 2013" and with date <= "feb 28 2013"

[404] 183914 items selected out of 2206402 items.

Note that in the above two examples, the message [4041] indicates that the search used an index and the message [404] indicates that no index was used.

See Also

& Logical Operator, Logical Expressions