DAYNAME

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

Read syntax diagramSkip visual syntax diagramDAYNAME(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 day that is returned is based on the language used for messages in the job. This name of the day is retrieved from message CPX9034 in message file QCPFMSG in library *LIBL.

Examples

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