Get Day of Week Name

GetDayName

The GetDayName procedure returns the day of the week, as a string, for the given date.

day-of-week-name GetDayName(
  InDate         D    Const Datfmt(*ISO) :
  nFormat      10I 0  Const Options(*NOPASS)
)

See also: DayOfWeek GetDayEx

Parameters

inDate
[input DateFmt(*ISO) const]  Any valid date data-type, including date fields and date literals. Since this parameter is read-only (CONST) the date value may be in any valid date format.
nFormat [optional]
[input Int4 const]  A control that indicates the format of the returned day name. The valid choices are as follows:
Symbolic Named Constant Value Description
GD_LONG 0 Returns the name as the full day name, such as Monday. This is the default.
GD_SHORT 1 Returns the name as an abbreviated day name, such as Sun, Mon, Tues, Wed, Thurs, Fri, Sat.

Return Value

The return value is the the name of the day of the week as described by the nFormat parameter. The full name or partial name is returned as a varying-length character string that may be assigned to a varying length or fixed-length field. 

If the function fails, the return value is an empty string, that is a blank value.