I am currently creating a first aid record/employee's first report of illness/injury form. According to Workers' Compensation legislation, incidents must be reported within 24 hours. In the form, I have two date fields, DateOfInjury and DateReported, respectively. The display and validation patterns for these are set to "MMMM D, YYYY".
I also have a text field in which the user can state the reason the incident was not reported on the it occurred. Essentially, if the values of the dates entered match, there is no reason to indicate why there was a discrepancy, so DateDiscrepancy would remain hidden. However, if there is a discrepancy (i.e., DateReported > DatedOfInjury), we want DateDiscrepancy to be visible and for an alert to appear, prompting the user to enter something in the DateDiscrepancy textfield.
(If we want to get really fancy, we could also create another condition that makes DateDiscrepancy required if var diff > 0 and throw another error if DateDiscrepancy is null under this condition.)
Here is the solution, invoked by a Calculate event. I've included a lot of comments to help those who, like me, fumble around in the dark until they figure it out.