Share via


Operators for Expressions

You can use a variety of operators in constructing expressions for your query, including mathematical and text operators.

Mathematical Operators

The following table lists the mathematical operators you can use in constructing an expression.

Operator

Operation

+, -

Unary positive, negative

+

Addition

-

Subtraction

*

Multiplication

/

Division

Note

Some databases make additional operators available, such as the "%" operator for modulus.

If you use more than one mathematical operator in an expression, the Query and View Designer processes the expression according to the following operator precedence. To override the default precedence, use parentheses around the portion of the expression that is to be evaluated first. If more than one operator of the same level is included, the operators are evaluated left to right.

  1. Unary + and -

  2. * and /

  3. + and -

Text Operator

You can perform one operation on text: concatenation, or the linking together of strings. In some databases, you can concatenate strings and perform other operations (such as removing extraneous spaces) using a single operator.

To concatenate a string, you can use the "+" operator in the Criteria Pane. If your database supports a different concatenation operator, the Query and View Designer might convert the "+" operator to the appropriate operator in the SQL pane. If you are entering expressions directly into the SQL pane, use the concatenation operator supported by your database management system. For details, refer to the documentation for your DBMS.

See Also

Concepts

Expressions in Queries

Other Resources

Querying with Parameters