Insert a Date in Three Separate Fields

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

Sometimes, especially when automating form templates, a Date variable must be divided into three separate fields: month, day, and year. If you use the same Date variable in each field, but change the format to the day (03), month (06), or year (90), your template may look like this:

Unfortunately, the first two format examples are ambiguous enough that HotDocs isn't sure where to insert the correct parts of the date. (Both 06 and 03 can represent months.) When a user enters a date in the first field, HotDocs looks at the Date detection order in HotDocs Options and interprets the first chunk of numbers in the answer as a month. Because the format example calls for only one portion of the date, HotDocs stops processing it, inserts the first number that meets the criteria specified in the format example, and then moves to the next field where it attempts to process the same date again. Often the end result is 06/06/90 rather than the correct result of 06/03/90.

To display Date variables correctly in three separate fields, you can create three Computation variables—one for each field. Each computation will extract the appropriate part of the date. Using three separate computations, the template looks like this:

Note: HotDocs can recognize dates entered in two orders: month-day-year (the default order in the United States) and day-month-year (the default outside the U.S.). You can select the default date entry order at HotDocs Options.

The following computations compute the month, day, and year of a Date variable.

Example:
//Month Computation
MONTH OF( Date Var )

//Day Computation
DAY OF( Date Var )

//Year Computation (4-digit year; use 9999 for the format)
YEAR OF( Date Var )

//Year Computation (2-digit year; use 09 for the format)
REMAINDER( YEAR OF( Date Var ), 100 )

 Date Var

Any Date variable.