Click or drag to resize

DoW Function

X#
Extract the number of the day of the week from a date.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax
 FUNCTION DoW(
	dDate AS DATE
) AS DWORD
Request Example View Source

Parameters

dDate
Type: Date
The date.

Return Value

Type: DWord
The day of the week as a number from 1 to 7, where 1 is Sunday, 2 is Monday, and so on.
For an invalid or NULL_DATE, DoW() returns 0.
Remarks
DoW() is a date conversion function that converts a date value to a number identifying the day of the week.
It is useful when you want date calculations on a weekly basis. DoW() is similar to CDoW(), which returns the day of week as a string instead of a number.
Examples
These examples illustrate CDoW() and its relationship to DoW():
X#
1? TODAY()                        // 09/01/98
2? DOW(TODAY())                    // 3
3? CDOW(TODAY())                // Tuesday
4? DOW(TODAY() - 2)                // 1
5? CDOW(TODAY() – 2)                // Sunday
See Also