Determine Day of Week for a Date

HotDocs Version:HD6, HD2005, HD2006, HD2007, HD2008, HD2009
Word Processor:Microsoft Word, WordPerfect
Added to Knowledge Base:September 2004

Sometimes, it is necessary to determine which day of the week a given date falls on. For example, if a payment due date falls on a Saturday or Sunday, you may want to determine the date of the following Monday.

The following computation determines the day of the week for a date, and then adds one or two days, if necessary, to return the date of the following Monday.

Note: The DAY OF WEEK expression returns the day of the week as an integer. Sunday has a value of 1, Monday has a value of 2, and so forth.
Example:
IF DAY OF WEEK( Date Var ) = 7
  Date Var + 2 DAYS 
ELSE IF DAY OF WEEK( Date Var ) = 1
  Date Var + 1 DAYS 
ELSE 
  Date Var 
END IF 

 Date Var

Any Date variable. In this example, it can be a payment due date.