• Login

DataSoft Corporation

Constants

ConstantDescriptionExample

String constants

Wrap string constants in apostrophes.

If a string contains an apostrophe, double the apostrophe.

[Country] == 'France'

[Name] == 'O''Neil'

Date-time constants

Wrap date-time constants in '#'.

[OrderDate] >= #2018-03-22 13:18:51.94944#

True

Represents the Boolean True value.

[InStock] == True

False

Represents the Boolean False value.

[InStock] == False

Enumeration

Specify an enumeration value using its underlying integer value.

[Status] == 1

You cannot specify an enumeration value using its qualified name. The following criteria is incorrect:

[Status] = Status.InProgress

You can use the class' static methods to register custom enumerations, and then refer to enumeration values as follows:

Status = ##Enum#MyNamespace.Status,InProgress#

Guid

Wrap a Guid constant in curly braces. Use Guid constants in a relational operation with equality or inequality operators only.

[OrderID] == {513724e5-17b7-4ec6-abc4-0eae12c72c1f}

Numeric

Specify different numeric constant types in a string form using suffixes:

  • Int32 (int) - 1
  • Int16 (short) - 1s
  • Byte (byte) - 1b
  • Double (double) - 1.0
  • Single (float) - 1.0f
  • Decimal (decimal) - 1.0m

[Price] == 25.0m

?

Represents a null reference that does not refer to any object.

We recommend using the IsNull unary operator (for example, "[Region] is null") or the IsNull logical function (for example, "IsNull([Region])") instead.

[Region] != ?

Thursday, 27 December 2018 Posted in Expressions Constants, Operators, and Functions