Neoview SQL Reference Manual (R2.3)
DAYOFWEEK Function
The DAYOFWEEK function converts a DATE or TIMESTAMP expression into an INTEGER
value in the range 1 through 7 that represents the corresponding day of the week. The value 1
represents Sunday, 2 represents Monday, and so forth.
DAYOFWEEK is a Neoview SQL extension.
DAYOFWEEK (datetime-expression)
datetime-expression
is an expression that evaluates to a datetime value of type DATE or TIMESTAMP. See
“Datetime Value Expressions” (page 220).
Example of DAYOFWEEK
Return an integer that represents the day of the week from the START_DATE column in the
PROJECT table:
SELECT start_date, ship_timestamp, DAYOFWEEK(start_date)
FROM persnl.project
WHERE projcode = 1000;
Start/Date Time/Shipped (EXPR)
---------- -------------------------- ------
1996-04-10 1996-04-21 08:15:00.000000 4
The value returned is 4, representing Wednesday. The week begins on Sunday.
DAYOFWEEK Function 339