# Compare Dates

This function is used to compare date values. Yate stores date values or timestamps as is documented here. The source may be a field value, a property value, a named variable's value, a track variable's value or a text string. The compare against field can be a text string, the contents of a named variable or the contents of a track's variable field. Note that when a value does not start with a valid date, it will be treated as zero.

When specifying named variables or text you may use any of the escape sequences described in Escape Sequences.

If you specify a result of Set, the action's test state will be set to True or False depending on the result of the test. If you specify a result of And, the action's test state will be set to false if the result of the test is false. If you specify result of Or, the action's test state will be set to true is the result of the test is true.

In stepwise execution mode the following holds:

- If the source is a named variable, the compare function is only performed once.
- If the source is a not a named variable, the compare function is interpreted as for all files unless the Any option is selected.
- A source of text is performed over every file unless the Once option is selected.

You can choose to save the per file results of the test to a track variable. This is not supported when comparing against a named variable. When setting a track variable, the Set, And, Or semantics are applied, therefore cumulative tests will be saved as expected. The result in the track variable will always be a 0 or 1. The Run statement can selectively choose which files are to be executed grouped based on the True or False value of a track variable.