Skip to main content
On this page

Kater SQL Functions Date parts

KATER__HOUR_OF_DAY

The hour of its day, from 0 to 23.

Family: Date parts

Syntax

KATER__HOUR_OF_DAY(field)

Arguments

ArgumentDescription
fieldThe timestamp, or a time of day.

Returns

A whole number. The field menu writes @format plain beside it, so it shows without a thousands separator.

Usage notes

  • A date has no time of day, so the compiler refuses it on a date.

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.ordered_at AS "Ordered At",
DIMENSION('ordered_at_hour_of_day', KATER__HOUR_OF_DAY(orders.ordered_at)) AS "Hour of Day"
FROM kater_dataset.orders AS orders
ORDER BY
1
LIMIT 3
Order IDOrdered AtHour of Day
O000002025-05-26T09:02:009
O000012025-11-28T09:21:009
O000022025-07-25T13:56:0013

Compiles to

EXTRACT(HOUR FROM orders.ordered_at)
DATE_PART(HOUR, orders.ordered_at)

See also