Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count based on age

Status
Not open for further replies.

jlhart76

Technical User
Feb 22, 2005
20
0
0
US
I'm using Crystal XI. In my database, I have fields {LName}, {FName} & {Birthdate}. Using these, I need to calculate how many are age 80 or greater. Thanks in advance.
 
Please see the age formula in faq767-995. Once you have created the age formula, you just need to use a record selection formula like:

{@age} >= 80

-LB
 
Did it, but now total # is the same as the # that are 80+, so # that are 80+ shows up as 100%.
 
If you intend to show people from all age ranges, then remove the record selection formula. If you want help with some other aspect of the report, you will have to describe the report structure and what you are trying to do, and also provide some sample data.

-LB
 
Please see original post. Need to calculate how many are age 80+. ex:

Name Age (calculated from birthdate)
Bob 75
Joe 80
Tom 79
Jane 84
Ann 81
Donna 72

Total # is 6
# aged 80+ is 3
Therefore, 50% are aged 80+
 
Your original post did not specify that you needed a percentage, only a total of those 80+.

Create a formula:

//{@over80} to be placed in the detail section and suppressed:
if {@age} >= 80 then 1

Then create a second formula:

//{@percent>80}:
sum({@over80}) % count({table.name})

Then select the formula and click on the % in the toolbar to display the % sign.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top