You are here: Functions > BETWEEN()

BETWEEN()

BETWEEN() returns True or False depending on whether a specified value is between a minimum and maximum value, inclusive of the end points.

Use BETWEEN() to test for ranges of values, such as whether a quantity is between 20,000 and 60,000 inclusive. You can also use it to test for ranges of dates or ranges of alphabetic characters.

Function Format

BETWEEN(value,min,max)

BETWEEN(value,max,min)

All three parameters must be of the same type: numeric, date or character. BETWEEN() returns True if value is between min and max inclusive and False if it is not. Values equal to the minimum or the maximum will also return True.

When numeric fields have different decimal precision, the comparison uses the highest level of precision found in any of the fields.

Date formats can differ for all three parameters because Analyzer evaluates the date independently of how it is stored in a data file or displayed in a View.

Character comparisons are case-sensitive. The character sort order depends on the language selected in the [Table Options] tab of the Options dialog. Analyzer’s Exact Character Comparison options govern the way Analyzer compares character strings. If the SET EXACT option is OFF, “A” is considered equal to “ABC” and “ABXYZ.” If the SET EXACT option is ON, “A” is not considered equal to “ABC.” The default setting for this option is OFF.

For more information about changing Exact Character Comparison options, see Exact Character Comparisons.

Examples

BETWEEN(5,4,7) = T

BETWEEN(5,5,7) = T

BETWEEN(5,6,7) = F

BETWEEN("abc","A","B") = F

BETWEEN("ABC","A","B") = T

BETWEEN("BCD","ABC","BB") = F

BETWEEN(`20011131`,`20011031`,`20011131`) = T