Skip to main content
On this page

Kater SQL Functions Date grains

KATER__DATE

The date, without its time of day.

Family: Date grains

Syntax

KATER__DATE(field)

Arguments

ArgumentDescription
fieldThe date or timestamp.

Returns

A date.

Usage notes

  • On a date, it gives the same date. Use it to group a timestamp by day.

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_date', KATER__DATE(orders.ordered_at)) AS "Date"
FROM kater_dataset.orders AS orders
ORDER BY
1
LIMIT 3
Order IDOrdered AtDate
O000002025-05-26T09:02:002025-05-26
O000012025-11-28T09:21:002025-11-28
O000022025-07-25T13:56:002025-07-25

Compiles to

The call compiles to the same SQL on DuckDB and on Snowflake.

CAST(DATE_TRUNC('DAY', orders.ordered_at) AS DATE)

See also