DURING sets the range to a whole period, such as last_month or 2026-Q3.
SINCE and UNTIL set the first and last day. The range applies to the
schema's date, or to the one ON picks.
DURING <named range or period>
SINCE <day> [UNTIL <day>]
Ranges include both ends. Dates are your hotel's local calendar dates, so a booking made at 00:30 on 1 September in Oslo is a 1 September booking.
DURING
DURING takes a named range or a period.
Last month
FROM rooms
SHOW occupancy, adr, revpar
DURING last_monthA quarter, month by month
FROM revenue
SHOW net_revenue, vat_amount
DURING 2026-Q3
GROUP BY monthThe next 30 days
Ranges can lie in the future. Room nights already booked count, so this shows what is on the books.
FROM rooms
SHOW occupancy, room_nights_sold
DURING next_30_days
GROUP BY room_typeSINCE and UNTIL
SINCE takes a day, and UNTIL takes a day after it. Without UNTIL, the
range runs to today. UNTIL needs a SINCE.
The last two weeks, up to yesterday
FROM rooms
SHOW room_revenue
SINCE -14d UNTIL yesterday
TIMESERIES dayThis year so far
FROM bookings
SHOW bookings, cancellation_rate
SINCE startOfYear(0y)
GROUP BY monthWhen a query has no range
Without DURING or SINCE, a query covers the schema's default range. That
is this_month for every schema but customers, which covers this_year.
With AS OF, the default is the 12 months
from the AS OF day. The sentence above the result names the range it used,
with "(default)" when you didn't set it.
Periods
| Written | Means |
|---|---|
2026-09-05 | that day |
2026-09 | September 2026 |
2026-W37 | ISO week 37 of 2026, Monday to Sunday |
2026-Q3 | July to September 2026 |
2026 | the whole year |
A date that doesn't exist is an error:
FROM rooms
SHOW occupancy
DURING 2026-02-30Named ranges
Weeks run Monday to Sunday.
| Named range | Covers |
|---|---|
today, yesterday, tomorrow | that day |
this_week, this_month, this_quarter, this_year | the whole current period, days still to come included |
week_to_date, month_to_date, quarter_to_date, year_to_date | the current period up to today |
last_week, last_month, last_quarter, last_year | the whole period before the current one |
next_week, next_month, next_quarter, next_year | the whole period after the current one |
last_7_days, last_30_days, last_90_days, last_12_months | the days up to and including today |
next_7_days, next_30_days, next_90_days | the days from today on |
this_month on 12 October covers 1 to 31 October. month_to_date covers 1 to
12 October.
Offsets from today
An offset counts days (d), weeks (w), months (m), quarters (q) or
years (y) from today: -7d is a week ago and +30d is 30 days ahead.
0m is today, and so is now. Offsets work in SINCE, UNTIL, AS OF,
COMPARE TO, and on the time axis in WHERE.
FROM bookings
SHOW bookings
SINCE -3m
GROUP BY channelDate functions
startOf<Period>(<offset>) is the first day, and endOf<Period>(<offset>)
the last day, of the period an offset lands in. The period is Day, Week,
Month, Quarter or Year, and the offset counts in the same unit.
| Written | On 12 October 2026 |
|---|---|
startOfMonth(-3m) | 1 July 2026 |
endOfMonth(-1m) | 30 September 2026 |
endOfWeek(-1w) | Sunday 11 October 2026 |
startOfYear(0y) | 1 January 2026 |
Date functions go wherever a day goes. They keep a range in whole periods as time passes, such as the last three full months, whatever today is.
The last three full months
FROM rooms
SHOW occupancy, adr
SINCE startOfMonth(-3m) UNTIL endOfMonth(-1m)
TIMESERIES monthRevenue from the start of this quarter, inside this year
FROM revenue
SHOW net_revenue
WHERE service_date >= startOfQuarter(0q)
DURING this_year
GROUP BY monthThe offset must count in the function's own unit:
FROM rooms
SHOW occupancy
SINCE startOfMonth(-3d)