Link to home
Start Free TrialLog in
Avatar of tracimcp
tracimcp

asked on

Calculate an average age in SQL Reporting Services off an age range

I have the following in SQL Reporting services:

Age Range    #    
<65                1
65-69             0
70-74             3
75-79             6
80-84             1
>85              10
Total            21
I need to display the Average Age and I'm not sure to do this.  Please help
Avatar of Raja Jegan R
Raja Jegan R
Flag of India image

Hope this is what you require:

SELECT AGE_RANGE, AVG(CNT) as average_val
FROM ur_table
GROUP BY AGE_RANGE

Kindly note that this will ignore NULL values.

Kindly revert if your requirement differs
Avatar of tracimcp
tracimcp

ASKER

The requirement is for the average age ex. 74 which is what is confusing
>> which is what is confusing

Kindly specify your exact requirements so that we can try to help you out.
II have the following in a matrix report in SQL Reporting Services.  At the bottom of the report it will have total  for the ages and also an average age.    I'm not sure how to do this will the age range.

Age Range    #    
<65                1
65-69             0
70-74             3
75-79             6
80-84             1
>85              10
Total            21
Average  Age  74
ASKER CERTIFIED SOLUTION
Avatar of Raja Jegan R
Raja Jegan R
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial