Skip to main content
On this page

Kater SQL Functions Conditions

KATER__IS_BETWEEN

True where the field is between the low and the high end, both ends included.

Family: Conditions

Syntax

KATER__IS_BETWEEN(field, low, high)

Arguments

ArgumentDescription
fieldThe number, date or timestamp to test.
lowThe low end. It is included. Or write one range parameter a reader supplies, for both ends.
highThe high end. It is included. Left out when a range parameter gives both.

Returns

TRUE or FALSE. It is NULL where the field is empty, so a filter leaves that row out.

Usage notes

  • A range parameter, such as a date range in the filter bar, gives both ends. Write it once, in place of low and high.

Example

This Sandbox query reads the sample shop’s orders. The table shows the rows that Kater gave.

SELECT
orders.quantity AS "Quantity",
EVAL(orders.count_distinct__order_id) AS "Orders"
FROM kater_dataset.orders AS orders
WHERE
KATER__IS_BETWEEN(orders.quantity, 2, 4)
GROUP BY
orders.quantity
ORDER BY
1
QuantityOrders
2601
3594
4595

Compiles to

The call compiles to the same SQL on DuckDB and on Snowflake.

orders.quantity BETWEEN 2 AND 4

See also