compare()
This function compares two (date) values a and b. The return value is:
1 if a > b.
0 if a = b.
-1 if a < b.
Important note: If date values are to be compared, they must be "real" date values and not strings. For example, from a field of type "Date" or from one of the date functions.
Parameters
|
Parameter |
Description |
|
a |
(Date) value 1. |
|
b |
(Date) value 2. |
Examples
|
Parameter a |
Parameter b |
Result |
|
23 |
45 |
-1 |
|
45 |
23 |
1 |
|
33 |
3 |
0 |
|
2024-07-15 11:12:37.817 |
2025-07-15 11:12:37.817 |
-1 |
|
2025-07-15 11:12:37.817 |
2024-07-15 11:12:37.817 |
1 |
|
2025-07-15 11:12:37.817 |
2025-07-15 11:12:37.817 |
0 |
|
aaa |
bbb |
0 (Note: Internal typecast of both values to 0.) |