MAKEDATE
Sintassi
MAKEDATE(anno, giorno)
Spiegazione
Dato un anno e un valore numerico che rappresenta il giorno dell'anno, restituisce una data. Se il valore di giorno non è superiore a 0 il risultato sarà NULL.
Esempi
MariaDB [(none)]> SELECT MAKEDATE(2011,31), MAKEDATE(2011,32); +-------------------+-------------------+ | MAKEDATE(2011,31) | MAKEDATE(2011,32) | +-------------------+-------------------+ | 2011-01-31 | 2011-02-01 | +-------------------+-------------------+ 1 row in set (0.00 sec) MariaDB [(none)]> SELECT MAKEDATE(2011,365), MAKEDATE(2014,365); +--------------------+--------------------+ | MAKEDATE(2011,365) | MAKEDATE(2014,365) | +--------------------+--------------------+ | 2011-12-31 | 2014-12-31 | +--------------------+--------------------+ 1 row in set (0.00 sec) MariaDB [(none)]> SELECT MAKEDATE(2011,0); +------------------+ | MAKEDATE(2011,0) | +------------------+ | NULL | +------------------+ 1 row in set (0.00 sec) MariaDB [(none)]>
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.