DAYNAME

The DAYNAME function returns the name of the weekday on which a given date falls. The name is returned in English.

Read syntax diagram
>>-DAYNAME(input-date)-----------------------------------------><

The schema is DSN8.

input-date
A valid date or valid character string representation of a date. A character string representation The string must have a data type of VARCHAR and an actual length that is not greater than 10 bytes. The date must be in ISO format.

The result of the function is VARCHAR(9).

The DAYNAME function uses the IBM® C++ classIDate.

The following table shows the external and specific names for DAYNAME. The specific names differ depending on the data type of the input argument.
Table 1. External and specific names for DAYNAME
Input arguments External name Specific name
input-date (VARCHAR)
DSN8EUDN DSN8.DSN8EUDNV
input-date (DATE)
DSN8EUDN DSN8.DSN8EUDND
Example 1: For the current date, find the day of the week.
   VALUES DSN8.DAYNAME( CURRENT DATE );
Example 2: Find the day of the week on which leap year falls in the year 2008.
   VALUES DSN8.DAYNAME( '2008-02-29' );
The result of the function is 'Friday'.
Example 3: Find the day of the week on which Delores Quintana, employee number 000130, was hired.
   SELECT  FIRSTNME || ' '
       ||  LASTNAME || ' was hired on '
       ||  DSN8.DAYNAME( HIREDATE ) || ', '
       ||  CHAR( HIREDATE )
     FROM  EMP
    WHERE  EMPNO  = '000130';
The result of the function is 'DELORES QUINTANA was hired on Wednesday, 1971-07-28'.