Page 4 of 10PREVNEXT

Queries IV: Use functions and calculated fields in your queries

Math operators for use in calculations

When you use a math function in an expression, you use operators — plus signs and other familiar symbols. Access uses all the common operators, plus a few you may not know.

Callout 1 If you need an exponent - a number multiplied by itself - use the caret (^). For example, the number eight, the caret, and the number 2 (8^2) is the same as 8 multiplied by 8.
Callout 2 If you need a negative value, place a minus sign to the left of the number. For example, -2.
Callout 3 To multiply, use the asterisk. To divide, use the forward slash (* /).
Callout 4 If you work with numbers that don't divide evenly, use the integer division operator, the backslash (\). For example, if you use the backslash to divide 26 by 10, the quotient — the result — is 2.
Callout 5 If you need to show the remainder of an integer division operation, use the mod, or modulus, operator. For example, 26 mod 10 gives a result of 6, the remainder of the integer division operation.
Callout 6 To add numbers, use the plus sign. To subtract, use the minus sign (+ -).

Now remember, Access executes math operations in the order listed here. For example, it performs an exponent operation before anything else, it multiplies before it divides, and it adds before it subtracts. That is called operator precedence. You can override operator precedence by using parentheses in your formulas, and that's next.

Page 4 of 10PREVNEXT