When an expression contains multiple operators, their precedence controls the order in which expression elements are evaluated.
- Literal values
- OR (left-associative)
- AND (left-associative)
- '.' relationship qualifier (left-associative)
- ==, !=
- <, >, <=, >=
- -, + (left-associative)
- *, /, % (left-associative)
- unary -
- Trim(), Len(), Substring(), IsNull()
- '' (for set-restriction)
The default precedence can be changed by grouping elements with parentheses. For instance, the operators are performed in a default order in the first of the following two code samples. In the second code sample, the addition operation is performed first, because its associated elements are grouped with parentheses, and the multiplication operation is performed last.
Accounts[Amount == 2 + 48 * 2]
Accounts[Amount == (2 + 48) * 2]