Skip to main content
On this page

Kater SQL Functions Date parts

KATER__QUARTER_OF_YEAR

The quarter's number, from 1 to 4.

Family: Date parts

Syntax

KATER__QUARTER_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

  • January to March is quarter 1. It is the calendar quarter, not a fiscal quarter.

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_quarter_of_year', KATER__QUARTER_OF_YEAR(orders.order_date)) AS "Quarter of Year"
FROM kater_dataset.orders AS orders
ORDER BY
1
LIMIT 3
Order IDOrder DateQuarter of Year
O000002025-05-262
O000012025-11-284
O000022025-07-253

Compiles to

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

See also