on 07-21-2018 7:40 PM
Hi Community,
I am using formula: daysbetween(daydate("PERSON_BIRTH_DATE"),daydate(now()))/365
to calculate the person age and it is working fine. However the above column have default dates such as 31 Dec 9999 in some peoples date of birth and brings a negative answer in age calculation. In the instance where the Persons birth age is listed as 31 Dec 9999 I want to exclude it and overwrite that negative result with todays date using (now()).
I have been trying to put this in an if statement but i keep on getting a conversion data type error message. The person age column is data type INTEGER and the "PERSON_BIRTH_DATE" column is DATE data type. Thank you.
Either Lars way two columns or.
Mine way single column output as below:
IF("PERSON_BIRTH_DATE" = '99991231',
0,
daysbetween(daydate("PERSON_BIRTH_DATE"),daydate(now()))/365
)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
instead of checking for the specific MAXDATE, check the result of the computation (I’d leave that in a separate calculated column) and replace anything <0 with the current date (if that’s what you want).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.