Products Downloads


French version


 

 

Syntax

DAY_OF_WEEK(Argument)

 

Description

The DAY_OF_WEEK SQL scalar function returns an integer between 1 and 7 that represents the day of the week, where 1 represents Monday.

 

The argument must be a date, or a timestamp.

 

The result of the function is an integer.

If the argument can be null, the result can be null; if the argument is null, the result is the null value.

 

Note the following peculiarities:

    • With DB2/400 and DB2/UDB, the ISO implementation of the DAYOFWEEK (DAYOFWEEK_ISO) function is used.
    • With SQL Server, the ISO implementation is forced by using the "SET DATEFIRST 1" option.

    • With ODBC, the result cannot be guaranteed, as the implementation of the function can vary according to the destination DBMS.

Example

Assume ORDER_DATE is February 15, 2003

 

DAY_OF_WEEK(ORDER_DATE) returns 6.

 

List of SQL scalar functions by topic

 

↑ Top of page

  • Aucune étiquette