> The problem here is that you cannot compare with a string value with the Dates.
This statement is wrong! In fact, in PA a date is a string and and you are doing string comparisons here.
> Now write your expression as formatDateTime('2024-11-24', dd/MM/yyyy) is less than formatDateTime('2024-11-30', dd/MM/yyyy)
If you do this, '01/01/2024' is less than '30/01.1999' because string comparison works from left to right and '0' is less than '3'
When comparing dates, ensure that the date is in ISO 8601 format (yyyy-MM-ddTHH:mm:ss, you might not need the time here), as returned by any PA date function.
> The datetime string must match ISO 8601 format.
Function formatDateTime() expects a valid date string as input.
If you value might be empty you either have to adapt your condition accordingly (check if empty before doing other checks that involve formatDateTime() or define a default value, see
coalesce())
But you probably don't need to use formatDateTime() at all if your dates are formatted correctly.