WEEKDAY Function

From a SAS date value, returns an integer that corresponds to the day of the week.

Category: Date and Time
Returned data type: DOUBLE

Syntax

WEEKDAY(expression)

Arguments

expression

specifies any valid expression that represents a SAS date value.

Data type DOUBLE
See <sql-expression>
FedSQL Expressions

Details

The WEEKDAY function produces an integer that represents the day of the week, where 1 = Sunday, 2 = Monday, …, 7 = Saturday.
For information about how FedSQL handles date and times values, see Dates and Times in FedSQL.

Example

The following statement illustrates the WEEKDAY function when the current day is Sunday:
Statements
Results
select weekday(today());
 1
Last updated: February 23, 2017