Add constraints on dates

I wanted to restrict the registration date to being after the date of birth, and I also wanted the records to be selected between January 1, 2020, and March 31, 2022. Accordingly, I developed the following command in my XLS form, but it doesn't work with the commands I developed. Could you please help me to solve this problem. FYI, I used the Ethiopian calendar, does it have any relation to the command I developed?
. >= ${date_of_birth} and .>=date('2022-01-30') and .<=date('2022-03-31') and .<=date(today())

Here's what I would do.

. >= decimal-date-time(${date_of_birth}) and .> = decimal-date-time('2022-01-30') and . <= decimal-date-time('2022-03-31') and . <= decimal-date-time(today())

For these kinds of problems, I find it helpful to wrap the dates in decimal-date-time. I also find that storing the values in calculates and outputting them in a note helps you debug issues much faster.

datetime.xlsx (251.0 KB)

1 Like

Dear @yanokwa thank you so much for your quick response. I have fixed it accordingly.