floor_date
Takes a date-time and rounds it down to the nearest date-time value of the specified time unit.
Syntax
floor_date(<date>, <unit>)
| Parameter | Type | Description |
|---|---|---|
| date | Date | The date value to process. |
| unit | Text | One of: MINUTE, HOUR, WEEK, DAY, MONTH, QUARTER, YEAR. |
Return values
Date
Usage
Rounds the date down to the first day of the month.
floor_date(orders.processed_at, MONTH)