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

Moderators: Moderators, Tech Support

Post Reply
bryonac
Posts: 1
Joined: Mon Feb 06, 2006 3:01 pm
Location: Walhalla, SC

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

Post 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

Zaphod
Program Development
Program Development
Posts: 830
Joined: Tue Sep 02, 2003 12:48 pm
Location: PowerChurch Software
Contact:

Post 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!
PowerChurch Software Technical Support
(800) 486-1800
http://www.powerchurch.com/

Post Reply