Page 1 of 1

How do I return the age of someone in a Custom Report?

Posted: Mon Feb 06, 2006 3:11 pm
by bryonac
I know that this has to be relatively simple but I am unfamiliar with FoxPro and the expression builder. I have created a custom report for my deacon family ministry that includes the birthdate and anniversary date for each member. What I want to do is return the actual age of each person. For example, if the person was born on 02/02/1974 the expression would report back 32 (as the person's age). How do I do this? I know it must be a simple mathimatical equation using the functions in Expression Builder, but the answer is alluding me.

Bryon

Posted: Mon Feb 06, 2006 4:17 pm
by Zaphod
You can try this expression:

Code: Select all

INT((DATE() -  PCPLUS.born)/365)
That takes today's date and subtracts the birthdate. This gives the difference in number of days, so divide by 365 to get # of years. The INT() function gives just the integer portion (ie, you don't get 32.34535624 years old, you get 32).

Hope that helps!