Relational expressions

2 minutes to read Download PDF Edit

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 (e.g. both numbers):

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

returns:

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 (e.g. both numbers):

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

returns:

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 (e.g. both numbers):

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

returns:

False

and

3<=3

returns:

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 (e.g. both numbers):

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

returns:

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 (e.g. both numbers):

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

returns:

False

or with a DateTime:

dateTime(2007) = dateTime(2007)

returns:

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 (e.g. both numbers):

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

returns:

False

Copyright © Mendix. All rights reserved. | Mendix.com | Terms of Use | Privacy Policy