Date-time comparisons
A date-time comparison is a comparison of the date or time values of two operands.
If an item of class date-time is compared to a nonnumeric operand (except for numeric-edited operands), the date-time item is treated as if it were nonnumeric.
During the comparison of an item of class date-time to an numeric-edited or numeric operand, the date-time item is de-edited. De-editing results in a numeric integer. This numeric integer is then numerically compared with the other operand.
During the comparison of one date-time item with another, the items are first converted to a common date, time, or timestamp format, and then compared. Characters that are part of a format literal, but which are not conversion specifiers (for example the / or - characters), have no effect on a date-time comparison.
When comparing a date item to a timestamp item, only the date portion of the timestamp is considered. When comparing a time item to a timestamp item, only the time portion of the timestamp is considered.