On this page
Kater SQL Functions Date parts
KATER__DAY_OF_YEAR
The day of its year, from 1 to 366.
Family: Date parts
Syntax
KATER__DAY_OF_YEAR(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 January is day 1, and 31 December is day 365, or 366 in a leap year.
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_year', KATER__DAY_OF_YEAR(orders.order_date)) AS "Day of Year"FROM kater_dataset.orders AS ordersORDER BY 1LIMIT 3| Order ID | Order Date | Day of Year |
|---|---|---|
| O00000 | 2025-05-26 | 146 |
| O00001 | 2025-11-28 | 332 |
| O00002 | 2025-07-25 | 206 |
Compiles to
EXTRACT(DAYOFYEAR FROM orders.order_date)DATE_PART(DAYOFYEAR, orders.order_date)