Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (Français) » SQL Anywhere Server - SQL Reference » Using SQL » SQL functions » SQL functions (A-D)

 

DOW function [Date and time]

Returns a number from 1 to 7 representing the day of the week of a date, where Sunday=1, Monday=2, and so on.

Syntax
DOW( date-expression )
Parameters
  • date-expression   The date to evaluate.

Returns

SMALLINT

Remarks

The DOW function is not affected by the value specified for the first_day_of_week database option. For example, even if first_day_of_week is set to Monday, the DOW function returns a 2 for Monday.

Standards and compatibility
  • SQL/2003   Vendor extension.

Example

The following statement returns the value 5.

SELECT DOW( '1998-07-09' );

The following statement queries the Employees table and returns the employees StartDate, expressed as the number of the day of the week:

SELECT DOW( StartDate ) FROM Employees;