Share via


Comparison Operators (DMX)

You can use comparison operators with scalar data in any Data Mining Extensions (DMX) expression in Microsoft SQL Server 2005 Analysis Services (SSAS). Comparison operators evaluate to a Boolean data type; they return TRUE or FALSE based on the outcome of the tested condition.

The following table identifies the comparison operators that DMX supports.

Operator Description

< (Less Than) (DMX)

For arguments that evaluate to a non-null value, returns TRUE if the value of the argument on the left is less than the value of the argument on the right; returns FALSE otherwise. If either argument or both arguments evaluate to a null value, the operator returns a null value.

> (Greater Than) (DMX)

For arguments that evaluate to a non-null value, returns TRUE if the value of the argument on the left is greater than the value of the argument on the right; returns FALSE otherwise. If either argument or both arguments evaluate to a null value, the operator returns a null value.

= (Equal To) (DMX)

For arguments that evaluate to a non-null value, returns TRUE if the value of the argument on the left is equal to the value of the argument on the right; returns FALSE otherwise. If either argument or both arguments evaluate to a null value, the operator returns a null value.

<> (Not Equal To) (DMX)

For arguments that evaluate to a non-null value, returns TRUE if the value of the argument on the left is not equal to the value of the argument on the right; returns FALSE otherwise. If either argument or both arguments evaluate to a null value, the operator returns a null value.

<= (Less Than or Equal To) (DMX)

For arguments that evaluate to a non-null value, returns TRUE if the value of the argument on the left is less than or equal to the value of the argument on the right; returns FALSE otherwise. If either argument or both arguments evaluate to a null value, the operator returns a null value.

>= (Greater Than or Equal To) (DMX)

For arguments that evaluate to a non-null value, returns TRUE if the value of the argument on the left is greater than or equal to the value of the argument on the right; returns FALSE otherwise. If either argument or both arguments evaluate to a null value, the operator returns a null value.

You can also use comparison operators in DMX statements and functions to look for a condition.

See Also

Reference

Data Mining Extensions (DMX) Reference
Data Mining Extensions (DMX) Function Reference
Data Mining Extensions (DMX) Operator Reference
Data Mining Extensions (DMX) Statement Reference
Data Mining Extensions (DMX) Syntax Conventions
Data Mining Extensions (DMX) Syntax Elements
Expressions (DMX)
Mapping Functions to Query Types (DMX)
Operators (DMX)
Prediction Queries (DMX)
Understanding the Select Statement (DMX)

Help and Information

Getting SQL Server 2005 Assistance