I am trying to calculate age from Date of Birth, which I was able to do successfully using this thread. However, some of my DateOfBirth have null values, and using my below formula, the result coms back as "2012" instead of (blank/null).
Here is my table:
10/06/1990
01/09/1998
*null*
*null*
02/16/1991
Here is my desired result:
23
25
(blank)
(blank)
22
Here is my formula so far:
year(curdate())-year(user.DateOfBirth) - (dayofyear(curdate()) < dayofyear(user.DateOfBirth)) AS 'Age'
Here is what I'm actually getting:
23
25
2012
2012
22
Here are a couple of things I've tried to eliminate the "2012", which results in some encrypted text:
IF(user.DateOfBirth > '0001-01-01',AboveFormula,'')
CASE AboveFormula WHEN 2012 THEN '' ELSE AboveFormula END AS 'Age'