Logic Operators

Logical NOT

The not operator converts a true result to false, and a false result to true.

For example, the following will return true if x is not equal to 5.

not x = 5

The following calculation will return true if the boolean field 'Report submitted' has not been ticked:

not [Report Submitted]

NOT has the highest precedence of the three logical operators. For example, the following calculation will return true:

not false and true

Logical AND

The and operator returns true if both of its inputs are true.

Example:

[Department] = 'Marketing' and [Quantity] > 100

AND has the second highest precedence of the three logical operators, after negation. For example, the following calculation:

a and b or c and d

is equivalent to:

(a and b) or (c and d)

Logical OR

The or operator returns true if either or both of its inputs are true.

Example:

[Cost] > 1000 or [Description] like '%urgent%'

OR has the lowest precedence of the three logical operators. For example, the following calculation:

a or b and c or d

is equivalent to:

a or (b and c) or d