Share via


Behavior of Null Values in Logical Expressions

Null values persist through logical expressions in most cases. The following table describes the behavior of null values in logical expressions.

Logical

expression

Result if

x=TRUE

Result if

x=FALSE

Result if

x=.NULL.

x AND .NULL.

.NULL.

FALSE

.NULL.

x OR .NULL.

TRUE

.NULL.

.NULL.

NOT x

FALSE

TRUE

.NULL.

When a conditional expression encounters a null value, the condition fails, because .NULL. is not true (.T.). For example, a FOR clause that evaluates to .NULL. is treated as false (.F.). Note that null values are treated as .NULL. until the entire expression is evaluated.

See Also

Concepts

NULL as a Value

NULL as a Parameter

Reference

FOR Clauses

Null Value Handling

Behavior of Null Values in Commands and Functions

Other Resources

Data Manipulation