Want Sum in Report Header of calculated field in Report Detail ?

M

Mel

I've got a calculated field in the Report Detail area of my Report...

The Expression is plugged into the fields Control Source and it looks
like this...

=IIf([OrdPmtAmt]>0,[NetCom],IIf([NewOrRetOrder]="Return",[NetCom],0))

The calculated field is named TransactionCom

There will be many rows on the reoport... one for each transaction...

I want to sum up the TransactionCom values and show that total in the
Report Header...

For a non calculated field I would use... =Sum ( [ fieldName ] )

But how do I do this for a field in the Report Detail with an
Expression in it?

I tried using the field name like this.. =Sum([TransactionCom])
but it didn't work.

Thanks for any help on this.
 
M

Mel_3

OK, I think I got this to work.

So for others here is how I did it.

I put the Expression in the Sum like this...

Sum ( IIf([OrdPmtAmt]>0,[NetCom],IIf([NewOrRetOrder]="Return",[NetCom],
0)) )

Note I had to take the "=" sign out before the iif

I'll do some more careful checking but so far it looks like this is
working.
 

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