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
| 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
- Sort by it to show months in the calendar’s order. Names from
KATER__MONTH_NAMEsort 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 ordersORDER BY 1LIMIT 3| Order ID | Order Date | Month Num |
|---|---|---|
| O00000 | 2025-05-26 | 5 |
| O00001 | 2025-11-28 | 11 |
| O00002 | 2025-07-25 | 7 |
Compiles to
EXTRACT(MONTH FROM orders.order_date)DATE_PART(MONTH, orders.order_date)