Skip to main content
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

ArgumentDescription
fieldThe 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 orders
ORDER BY
1
LIMIT 3
Order IDOrder DateDay of Year
O000002025-05-26146
O000012025-11-28332
O000022025-07-25206

Compiles to

EXTRACT(DAYOFYEAR FROM orders.order_date)
DATE_PART(DAYOFYEAR, orders.order_date)

See also