Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Calculate a person's age to the report

HI I have a field that contains the Patient's birthday. The report is looking for the Patients age.

I was looking for a formula that would give the years between 2 dates, with the to date being of course today's date. I guess that we don't want to round up, that is, someone is not the next year until the actual date match.

There is a command in other script languages called Subdur (subtract duration) that would give the time between two dates. I was wondering if something like this can be had in Crystal as well.

Former Member replied

Hi Philky:

Try this formula:

If totext(CurrentDate,"MM/dd")>=totext({Birth Date},"MM/dd")

then Year(CurrentDate)-Year({Birth Date})

else Year(CurrentDate)-Year({Birth Date})-1

There are other formulas out there that will have you subtract the years and divide by 360 (or some other #) but if accuracy is important, this is the only way to do it as the other methods are not 100% accurate. It looks to see if the the birth month and day has passed, if it has, it subtracts the years, if it hasn't it subtracts the years and minuses 1.

Deb

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question