On this page
Kater SQL Functions Date parts
KATER__DAY_OF_QUARTER
The day of its quarter, counted from 1.
Family: Date parts
Syntax
KATER__DAY_OF_QUARTER(field)Arguments
| Argument | Description |
|---|---|
field | The date or timestamp. |
Returns
A whole number. The field menu writes @format plain beside it, so it shows without a thousands separator.
Usage notes
- 1 April is day 1 of its quarter, and 30 June is day 91.
Example
This Sandbox query reads the sample shop’s orders. The table shows the rows that Kater gave.
SELECT orders.order_id AS "Order ID", orders.order_date AS "Order Date", DIMENSION('order_date_day_of_quarter', KATER__DAY_OF_QUARTER(orders.order_date)) AS "Day of Quarter"FROM kater_dataset.orders AS ordersORDER BY 1LIMIT 3| Order ID | Order Date | Day of Quarter |
|---|---|---|
| O00000 | 2025-05-26 | 56 |
| O00001 | 2025-11-28 | 59 |
| O00002 | 2025-07-25 | 25 |
Compiles to
DATE_DIFF( 'DAY', CAST(DATE_TRUNC('QUARTER', orders.order_date) AS DATE), CAST(orders.order_date AS DATE)) + 1DATEDIFF( DAY, CAST(DATE_TRUNC('QUARTER', orders.order_date) AS DATE), CAST(orders.order_date AS DATE)) + 1