Sum of records based on another field

C

Cioffredi

This should be easy but ... In a record I have a [Climber],[# of Hours] and
[Access Type]. Access Type can be either "Roped Access" or "Webbing
Climbing". That said, a report runs from qry with criteria of climber.

In my report I would like to have a 2 text boxes sum the number of hours
based the 2 types of climbing. This is the code I have tried to use and it
gets kicked back at me. If I take out the WHERE statement, it works but for
the combined total.

=Sum(nz([# of Hours])) WHERE ( [Access Style] ="Roped Access");

Any suggestions? ... Thanks in advance!
 
C

Cioffredi

Found Answer in a different Post.

=Sum(IIf([Access Style]="Roped Access",[# of Hours],0))
 
Top