Expressions Overview

  • 2 minutes to read

An expression is a string that, after parsing and processing, returns a value. Expressions consist of column/field names, operators, functions, and constants. See the following examples of expressions:

  • "[Quantity] * [UnitPrice] * (1 - [BonusAmount])"
  • "[FirstName] + ' ' + [LastName]"
  • "[Country] == 'USA'"
  • "[OrderDate] > #8/16/1994# AND [Quantity] > 20"

Expressions for unbound columns/fields can evaluate values of any type. Expressions that represent criteria for conditional formatting rules have to evaluate boolean values.

You can use the Expression Editor to create or edit expressions.

Syntax Rules

Follow the syntax conventions below when creating or editing expressions:

  • Enclose data field names in square brackets (for example, [Products.ProductName]).
  • Type a question mark before query parameters names (for example, ?parameter1).

    Add the "Parameters" prefix before report parameters names (for example, [Parameters.parameter1]).

  • Enclose string values in apostrophes (for example, 'USA'). An attempt to use quotes instead results in an error.

    Type a double apostrophe to embed an apostrophe into an expression's text (for example, 'It''s sample text').

  • Enclose date-time constants in hashtags (for example, [OrderDate] >= #1/1/2016#).
  • Use a question mark to represent a null reference (one that does not refer to any object) (for example, [Region] != ?).
  • If an expression uses different types, you can convert them to the same type using dedicated functions (for example, Max(ToDecimal([Quantity]),[UnitPrice])).

Refer to the Criteria Language Syntax topic to learn more.