BETWEEN macro

The BETWEEN macro is available only in Unica Campaign.

Syntax

value1 BETWEEN value2 AND value3

Parameters

Equivalent to value1 >= value2 AND < value3

Description

BETWEEN is a special variant of the comparison predicate. The details of this predicate are important and the order of the operands has some unexpected implications. See the examples section.

Note: FROM and FOR use identical syntax.

Examples

10 BETWEEN 5 AND 15 Is true, but: 10 BETWEEN 15 AND 5 Is false:

because the equivalent way of expressing BETWEEN (using AND) has a specific order that does not matter when you are using literals, but might matter a good deal if you provide value2 and value3 by using host variables, parameters, or even subqueries.