Skip to main content
On this page

Kater SQL Functions Date parts

KATER__MONTH_NUM

The month's number, from 1 to 12.

Family: Date parts

Syntax

KATER__MONTH_NUM(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

  • Sort by it to show months in the calendar’s order. Names from KATER__MONTH_NAME sort in alphabetical order.

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_month_num', KATER__MONTH_NUM(orders.order_date)) AS "Month Num"
FROM kater_dataset.orders AS orders
ORDER BY
1
LIMIT 3
Order IDOrder DateMonth Num
O000002025-05-265
O000012025-11-2811
O000022025-07-257

Compiles to

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

See also