Description:
Perform comparison operation on parameters.
Syntax:
|
cmpx(it1,it2) |
Compare parameter it1 and parameter it2. When it1 is greater than it2, return 1; when it1 is equal to it2, return 0; when it1 is less than it2, return -1. |
|
it1 ? it2 |
? is the comparison operator, which can be >, == or < , and return Boolean value. |
Note:
The function performs comparison operation on parameter it1 and parameter it2.
Parameter:
|
it1 / it2 |
A date/time/datetime/time interval constant/numeric value. |
Return value:
-1/0/1/Boolean
Example:
|
|
A |
|
|
1 |
=cmpx(date("2025-12-12"),date("2025-12-9")) |
Compare two date parameters. As parameter 1 is greater than parameter 2, return 1. |
|
2 |
=cmpx(datetime("2025-12-2 20:10:10"),datetime("2025-12-9 21:10:11")) |
Compare two datetime parameters and return -1. |
|
3 |
=cmpx(subx(date("2025-12-12"),date("2025-12-9")),itx(,3)) |
Compare the difference (the number of days) between 2025-12-12 and 2025-12-9 with 3 days and return 0. |
|
4 |
=cmps(1,2) |
-1 |
|
5 |
=time("11:02:10")>time("13:02:10") |
false |