Skip to main content
YEAR_MONTH_DAY
Tom Williams avatar
Written by Tom Williams
Updated over a year ago

Type: Formatter

Function: YEAR_MONTH_DAY

Syntax: YEAR_MONTH_DAY(datetime)

Description: Format a datetime in YYYY-MM-DD format (e.g. “2023-11-07”). This formatter is used to group records in “year + month + day” blocks, ignoring hours, minutes, and seconds.

Sample usage:

  • YEAR_MONTH_DAY("2020-04-17") returns 2020-04-17.

  • YEAR_MONTH(created_at) returns the created_at field value in YYYY-MM-DD format.

Did this answer your question?