Aller au contenu

Arrondit une date ou une date avec heure (horodatage/datetime) au premier jour du mois. Renvoie la date.

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>)
Arguments Description
<expr> date/horodatage

DATE, renvoie la date au format « 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 │
└─────────────────────────────────────────────────┘