Within

Determines whether the given value is within a given range.

Syntax

Within(s1, s2, s3)

Parameters

Parameter

Description

s1

The value to test for.

If s1 is a number, the ordering comparison is numeric.

If s1 is not a number, the ordering comparison uses the collating sequence for the current locale.

For more information, see Locales.

If s1 is null, the function returns null.

s2

The lower bound of the test range.

s3

The upper bound of the test range.

Examples

The following expressions are examples that use the Within function:

Expression

Returns

Within("C", "A", "D")

True (1)

Within(1.5, 0, 2)

True (1)

Within(-1, 0, 2)

False (0)

Within($, 1, 10)

True (1) if the current value is between 1 and 10.

// Ethnio survey code removed