MONTHNAME

Returns a mixed case character string containing the name of the month (for example, January) for the month portion of the argument.

Read syntax diagramSkip visual syntax diagramMONTHNAME(expression )
expression
An expression that returns a value of one of the following built-in data types: a date, a timestamp, a character string, or a graphic string.

If expression is a character or graphic string, its value must be a valid string representation of a date or timestamp. For the valid formats of string representations of dates and timestamps, see String representations of datetime values.

The result of the function is VARCHAR(100). If the argument can be null, the result can be null; if the argument is null, the result is the null value.

The CCSID of the result is the default CCSID of the current server.

Note

National language considerations: The name of the month that is returned is based on the language used for messages in the job. This name of the month is retrieved from message CPX3BC0 in message file QCPFMSG in library *LIBL.

Examples

  • Assume that the language used is US English.
    SELECT MONTHNAME( '2003-01-02' )
      FROM SYSIBM.SYSDUMMY1
    Results in 'January'.