DOW Function [Date and Time]

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

Syntax

DOWdate-expression )

Parameters

Parameters

Parameter

Description

date-expression

The date.

Returns

SMALLINT

Remarks

Use the DATE_FIRST_DAY_OF_WEEK option if you need Monday (or another day) to be the first day of the week.

Standards and Compatibility

  • SQL—Vendor extension to ISO/ANSI SQL grammar.

  • Sybase—Not supported by Adaptive Server Enterprise.

Example

The following statement returns the value 5:

SELECT DOW( '1998-07-09' ) FROM iq_dummy