MONTHNAME
Descriptionβ
Returns the English name of the month corresponding to a given date. The returned value is the full English name of the month (from January to December).
Syntaxβ
MONTHNAME(<date>)
Parametersβ
Parameter | Description |
---|---|
<date> | The input datetime value, which can be of type DATE, DATETIME, or DATETIMEV2 |
Return Valueβ
Returns a value of type VARCHAR representing the English name of the month:
- Possible return values: January, February, March, April, May, June, July, August, September, October, November, December
- If the input is NULL, the function returns NULL.
- The first letter of the return value is capitalized, and the remaining letters are in lowercase.
Exampleβ
SELECT MONTHNAME('2008-02-03 00:00:00');
+---------------------------------------------------------+
| monthname(cast('2008-02-03 00:00:00' as DATETIMEV2(0))) |
+---------------------------------------------------------+
| February |
+---------------------------------------------------------+