Average Age for each Gender listed on Parameter Query Based Report

W

WebDude

Hello :)

Using MS Access 2000, I based a report on a PARAMETER query, not realizing
the Domain Aggregate functions would then not work and So, to display the
total number of records for each [gender] i used...

=Sum(abs([gender]='Female'))
and
=Sum(abs([gender]='Male'))


Now, using the age in the [age] field of each record, id like to calculate
the AVERAGE AGE for EACH GENDER on the report. But Im not sure which
direction i should take to program this.. any ideas?


Cheers,
jeff
 
D

Duane Hookom

Try
=Sum(abs([gender]='Female') *
[AgeFieldExpression])/Sum(abs([gender]='Female'))
 
W

WebDude

Thanks Duane!


I also found this off the newsgroups...

=Avg(IIf([gender]="male",[age],Null))



WebDude Out.




Duane Hookom said:
Try
=Sum(abs([gender]='Female') *
[AgeFieldExpression])/Sum(abs([gender]='Female'))

--
Duane Hookom
MS Access MVP
--

WebDude said:
Hello :)

Using MS Access 2000, I based a report on a PARAMETER query, not realizing
the Domain Aggregate functions would then not work and So, to display the
total number of records for each [gender] i used...

=Sum(abs([gender]='Female'))
and
=Sum(abs([gender]='Male'))


Now, using the age in the [age] field of each record, id like to calculate
the AVERAGE AGE for EACH GENDER on the report. But Im not sure which
direction i should take to program this.. any ideas?


Cheers,
jeff
 
Top