Dear @mathieubossaert,
I did some further tests, with the following extended example.
date_time_comparison02.xlsx (900.0 KB)
There seems to be a problem in Collect (or at least strange behaviour).
ODK Collect (I tested with v2024.3.0 Beta 8)
Different to Enketo (tested with https://getodk.org/xlsform/)
In Collect: number() function and also $-reference in label for dateTime variable seem incomplete. Only if the date part is different, it works as expected.
Hint: date time or datetime (spelling) is automatically converted to type="dateTime" in XML file.
Hint @LN: Type in spec is dateTime, but datetime in ODK template? Same spelling would be better?


