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

Type: Formatter

Function: YEAR_MONTH

Syntax: YEAR_MONTH(datetime)

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

Sample usage:

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

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

Did this answer your question?