Ir al contenido

Redondea hacia abajo una fecha, o fecha con hora (marca de tiempo/datetime), al primer día del mes. Devuelve la fecha.

func.to_start_of_month(<expr>)
func.to_start_of_month('2023-11-12 09:38:18.165575')
┌────────────────────────────────────────────────────────────────┐
│ func.to_start_of_month('2023-11-12 09:38:18.165575') │
│ Date │
├────────────────────────────────────────────────────────────────┤
│ 2023-11-01 │
└────────────────────────────────────────────────────────────────┘
TO_START_OF_MONTH(<expr>)
Argumentos Descripción
<expr> fecha/marca de tiempo

DATE, devuelve la fecha en el formato “YYYY-MM-DD”.

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