BEGINNING_OF_QUARTER
Tom Azernour avatar
Written by Tom Azernour
Updated over a week ago

Type: Function

Function: BEGINNING_OF_QUARTER

Syntax: BEGINNING_OF_QUARTER(datetime)

Description: Returns a datetime corresponding to the beginning of the quarter for the provided datetime or NOW if no value is provided.

Sample usage:

  • BEGINNING_OF_QUARTER(created_at) returns the created_at field value set at midnight on the first day of the quarter. If created_at is equal to 2023-02-23T15:39:21Z then BEGINNING_OF_QUARTER(created_at) returns 2023-01-01T00:00:00Z.

  • BEGINNING_OF_QUARTER() is equivalent to BEGINNING_OF_QUARTER(NOW())

  • BEGINNING_OF_QUARTER(DATE(2023, 4, 15)) is equal to DATE(2023, 4, 1)

Did this answer your question?