but you’re also using two different variables here @andreyandrievich - the one that doesn’t work is subtracting P_AgeMax whereas the one that doesn’t work is using P_AgeMin
Is it possible that this difference is causing the issue?
You are comparing two text strings so the < or > than block is going to treat them as words and sort them alphabetically.
I tested this and 2/1/22 < 3/29/21 evaluates as true because the first character on the left “2” comes before the first character on the right “3”.
These blocks evaluate to true and the result when previewed is “<”:
I think you either need to compare dates to dates (not strings to strings) or you need to parse the date string you’re using and check the day, then the month, and then the year.
Or… use an API to determine which date comes first.
The most accurate way to compare two dates would be to convert them into Unix/epoch format and compare those.
Unfortunately at this time, the moment/luxon(?) Library blocks available in thunkable are super limited making working with dates difficult.
One way to compare would be to use something like
Yearmonthday values with no punctuation like slash or hyphen
For example
20210323 or March 23 2021
Then you can compare numbers which is easier
20210323 > 20210321 evaluates if March 23 is bigger than March 21 and since date is an expression of time passed since the beginning, this makes sense and works.
You need to compare the first character of the value in the property “Birthday” and compare it with the first character of “day of the month”
For today, “29” then all dates of “Birthday” will be less than unless the birthday is “30” of the month. Assuming your “Birthday” variable has leading zeros.