VeloDB Cloud
SQL Manual
Functions
date-time-functions
to_monday

to_monday

Description

Syntax:

DATE to_monday(DATETIME date)

This function returns the date of the closest Monday to the given date. For example, if you input 1970-01-01, 1970-01-02, 1970-01-03 and 1970-01-04, the function will return 1970-01-01.

Example

MySQL [(none)]> select to_monday('2022-09-10');
+----------------------------------+
| to_monday('2022-09-10 00:00:00') |
+----------------------------------+
| 2022-09-05                       |
+----------------------------------+

Keywords

MONDAY