Function DoW() Foundation

Converts a date value to a numeric weekday.

Syntax
DoW( <dDate> ) --> nDayOfWeek
Parameters
<dDate>
<dDate> is a date expression whose value is converted to the numeric weekday.
Return

DoW() returns the weekday as a number between 1 and 7. The first weekday (Sunday) has the value 1. The last weekday (Saturday) has the value 7. When <dDate> is empty or invalid, DoW() returns the value zero.

Description

DoW() is a conversion function with which a date value is converted to a number indicating the weekday. Using this function, date calculations may be made on a weekly basis. DoW() is similar to the function CDow() which returns the weekday as a character string.

Examples
DoW()
// The example shows results of DoW() in comparison to CDow() 

PROCEDURE Main 

   ? Date()                        // result: 12/06/94 
   ? DoW(Date())                   // result: 3 
   ? CDow(Date())                  // result: Tuesday 
   ? DoW(Date() - 2)               // result: 1 
   ? CDow(Date() - 2)              // result: Sunday 

RETURN 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.