I need to know how to show months as an age for this formula. It will calculate only in years and if I have a patient that is 10 months old the formula shows 0 as an age when I really want 10 months.
// birthday feb 29 and current year is leap year
if month({pat.birthdate})=2 and day({pat.birthdate})=29 and
day(date(year(CurrentDate),3,1)-1)=28
then
if date(year(CurrentDate),month({pat.birthdate}),day({pat.birthdate})- 1) > CurrentDate
then year(CurrentDate)-year({pat.birthdate})-1
else year(CurrentDate)-year({pat.birthdate})
else
// birthday not feb 29 or current year is a leap year
if date(year(CurrentDate),month({pat.birthdate}),day({pat.birthdate})) > CurrentDate
then year(CurrentDate)-year({pat.birthdate})-1
else year(CurrentDate)-year({pat.birthdate})
// birthday feb 29 and current year is leap year
if month({pat.birthdate})=2 and day({pat.birthdate})=29 and
day(date(year(CurrentDate),3,1)-1)=28
then
if date(year(CurrentDate),month({pat.birthdate}),day({pat.birthdate})- 1) > CurrentDate
then year(CurrentDate)-year({pat.birthdate})-1
else year(CurrentDate)-year({pat.birthdate})
else
// birthday not feb 29 or current year is a leap year
if date(year(CurrentDate),month({pat.birthdate}),day({pat.birthdate})) > CurrentDate
then year(CurrentDate)-year({pat.birthdate})-1
else year(CurrentDate)-year({pat.birthdate})