BETWEEN function

The Klipfolio BETWEEN function determines if the value or values are between the start and end values. The result evaluates to either TRUE or FALSE.

The syntax for the BETWEEN function is:

BETWEEN ( values , start , end )


values The value set. vector
start The start value. scalar
end The end value. scalar

BETWEEN example

Let's look at a BETWEEN function example.






1 02-Jan-14 Apples Green 10
2 03-Feb-14 Pears Yellow 20
3 04-Feb-14 Apples Red 30
4 05-Feb-14 Pears Green 40

The following example is based on the above text from an Excel spreadsheet:

SELECT(D:D (BETWEEN( DATE( A:A , "d-MMM-yy" ) , DATE_STARTOF( TODAY( ) , month ) , DATE_ENDOF( TODAY( ) , month ) ) ) ) 

-> [20, 30, 40]

Returns the dates between the first and end of the current month, Feb-2014.

Note that dates must be converted to Unix time format in order to be evaluated by the BETWEEN function.

Related links: