Partilhar via


Working with Literals in Formulas and Filters (Report Builder)

Filter conditions and expressions can both use literals and variables. A literal is a constant value whereas, a variable represents a set of values that can change. For example, suppose you add the literal value #12/15/2005# for a date to a formula. When the results of the formula are displayed, the date "12/15/2005" is displayed as well. If you were to use a variable, the data would change depending on the underlying data source. For example, you might use the field OrderDate in the formula; the result would display each instance of the OrderDate field.

To indicate to Report Builder that the value should be treated as a literal, you need to use a specific symbol depending on the type of data.

The following table indicates which symbol is used with each character type.

To make the following a literal: Use this symbol:

Date

#<Date>#

For example, the literal date #1/25/2009# renders as: 1/25/2009.

Text

"<String>"

For example, the literal string "The following bicycle parts are replaceable:" renders as: The following bicycle parts are replaceable:

Decimal

<Decimal>m

For example, the literal decimal 1.435m renders as: 1.435.

Remarks

Note the following when working with literals:

  • Float, integer, and Boolean values do not require a special symbol.
  • The Define Formula and Filter Data dialog boxes are not case sensitive; therefore, function names and Boolean values can be typed in lowercase or uppercase letters. Case sensitivity of strings depends on the underlying data source.
  • Report Builder automatically converts a decimal to a floating value when required in the formula; therefore, you can create formulas that require this conversion without having to specify whether the value is a float or a decimal.

See Also

Concepts

Working with Filters (Report Builder)
Working with Formulas (Report Builder)
Using Functions (Report Builder)

Help and Information

Getting SQL Server 2005 Assistance