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))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top