Examples: DateVar1 > DateVar2 DateVar1 >= DateVar2 DateVar > DATE OF( 25, 12, 2000 ) DateVar > DATE OF( 25, 12, YEAR OF( TODAY ) ) Date is after Christmas of the current year: FALSE IF DateVar >= DATE OF( 25, 12, YEAR OF( TODAY ) ) TRUE END IF
You can compare two dates using the normal comparison operators, as described in Computation #0011: Comparing Dates. To find if date X is after date Y, use one of these operators:
The X and Y values must both be HotDocs date values, not just strings containing dates. In other words, both dates must be either date variables or must use the DATE OF( day, month, year ) model, as shown in the examples above.
Because the year of the date we are comparing is not always fixed, it is sometimes good to use the YEAR OF( TODAY ) model. For example, so see if a date is after Christmas of the current year, use the fourth example in the first set of examples above. This is duplicated in the "Christmas" example, which looks at DateVar and determines if it occurs on or after Christmas of the current year. If it does, the computation returns TRUE. Otherwise it returns false.