Skip to content

Rounds down a date or date with time (timestamp/datetime) to the first day of the quarter. The first day of the quarter is either 1 January, 1 April, 1 July, or 1 October. Returns the date.

func.to_start_of_quarter(<expr>)
func.to_start_of_quarter('2023-11-12 09:38:18.165575')
┌────────────────────────────────────────────────────────────────┐
│ func.to_start_of_quarter('2023-11-12 09:38:18.165575') │
│ Date │
├────────────────────────────────────────────────────────────────┤
2023-10-01
└────────────────────────────────────────────────────────────────┘
TO_START_OF_QUARTER(<expr>)
ArgumentsDescription
<expr>date/timestamp

DATE, returns date in “YYYY-MM-DD” format.

SELECT
to_start_of_quarter('2023-11-12 09:38:18.165575')
┌───────────────────────────────────────────────────┐
│ to_start_of_quarter('2023-11-12 09:38:18.165575') │
Date
├───────────────────────────────────────────────────┤
2023-10-01
└───────────────────────────────────────────────────┘