Mendix 7 is no longer supported unless you have Extended Support (for details, please contact Mendix Support). Mendix 7 documentation will remain available for customers with Extended Support until July, 2024.

Relational expressions

Last modified: August 2, 2022

Relational expressions allow the user to compare variables and base changes and actions upon that information. The return type of such expressions is always boolean.

Less than ( < )

Determines whether the first value is less than the second value. Result is of type Boolean.

Input parameters

The values be any of the following types, but the two values should be in the same category (for example, both numbers):

  • String
  • Numeric (Integer/Long, Decimal, Float)
  • DateTime
1
4<3

returns:

1
False

Greater than ( > )

Determines whether the first value is greater than the second value. Result is of type Boolean.

Input parameters

The values be any of the following types, but the two values should be in the same category (for example, both numbers):

  • String
  • Numeric (Integer/Long, Decimal, Float)
  • DateTime
1
4>3

returns:

1
True

Less than or equal to ( <= )

Determines whether the first value is less than or equal to the second value. Result is of type Boolean.

Input parameters

The values be any of the following types, but the two values should be in the same category (for example, both numbers):

  • String
  • Numeric (Integer/Long, Decimal, Float)
  • DateTime
1
6<=3

returns:

1
False

and

1
3<=3

returns:

1
True

Greater than or equal to ( >= )

Determines whether the first value is greater than or equal to the second. Result is of type Boolean.

Input parameters

The values be any of the following types, but the two values should be in the same category (for example, both numbers):

  • String
  • Numeric (Integer/Long, Decimal, Float)
  • DateTime
1
4>=3

returns:

1
True

Is equal to ( = )

Determines whether the two values are equal. Result is of type Boolean.

Input parameters

The values be any of the following types, but the two values should be in the same category (for example, both numbers):

  • String
  • Numeric (Integer/Long, Decimal, Float)
  • DateTime
  • Domain Entity. Equality is checked based on the ID of the object.
1
"mystring" = "myotherstring"

returns:

1
False

or with a DateTime:

1
dateTime(2007) = dateTime(2007)

returns:

1
True

Is not equal to ( != )

Determines whether the two values are not equal. Result is of type Boolean.

Input parameters

The values be any of the following types, but the two values should be in the same category (for example, both numbers):

  • String
  • Numeric (Integer/Long, Decimal, Float)
  • DateTime
  • Object. Equality is checked based on the ID of the object.
1
"mystring" != "mystring"

returns:

1
False