cancel
Showing results for 
Search instead for 
Did you mean: 

Calculating Person Age

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member267922
Participant
0 Kudos

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
   )
lbreddemann
Active Contributor
0 Kudos

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).