There are multiple routs to get around this issue. One, and the most easy one, would be to parse the date to a string giving you just the date part. i.e. formatDate($SupT/StartDate, 'yyyyMMdd')>= formatDate($Cluster/StartDate, 'yyyyMMdd').
And on a side note if you are doing this in an exclusive split you don't need to use the if statement. using
$SupT/StartDate >= $Cluster/StartDate
Is enough because this already returns true or false.
Edit: and if you want to be able to calculate with those days you should cast those strings to an Integer.
You said "Unfortunately, when dates are equal false (instead of true) is returned". I'm assuming this is because you want only to compare the date part (ignoring the time part) of the DateTime
values?
Because a Mendix DateTime
value always contains a time part, you'll first want to "round" your DateTime
to a "date" before doing the comparison, like this:
trimToDays($SupT/StartDate) >= trimToDays($Cluster/StartDate)
Note that while Pieter's suggestion will give you the correct answer in practice, you're actually performing a lexicographical comparison and not an arithmetic one. So theoretically there is the possibility it might give weird/unexpected results.
You could use the TrimToDays to set the timestamp equal.