Sum Expression using WHERE clause??

J

Jaded in Cali

I am trying to place two sums in the header of a report. One sums the values
in a CREDITS field when the SUM_CODE field equals "K" and the other when the
SUM_CODE field equals "B".

I remember creating expressions several years ago that used a WHERE clause
to select only certain data to sum, count, or whatever. Is there a reference
to this syntax? As I remember, it was very tempermental. When the Control
Source property window accepts the expression I create, I still get a "#Name"
error in the report.
 
O

Ofer

Try this
=Sum(IIf([SUM_CODE]="K", [CREDITS],0))

=Sum(IIf([SUM_CODE]="B", [CREDITS],0))
 
Top