DAYNAME: Returning the Name of the Day From a Date Expression

How to:

DAYNAME returns a character string that contains the data-source-specific name of the day for the day part of a date expression.

Syntax: How to Return the Name of the Day From a Date Expression

DAYNAME(date_exp)

where:

date_exp

Is a date or date-time expression.

Example: Returning the Name of the Day From a Date Expression

The following request returns the name of the day from the TIME_DATE field.

TABLE FILE WF_RETAIL_TIME
PRINT TIME_DATE
COMPUTE DAYNAME1/A12 = DAYNAME(TIME_DATE);
WHERE RECORDLIMIT EQ 5
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLE *
GRID=OFF,$
ENDSTYLE
END

The output is shown in the following image.