Conditional sum in Report

CEH

Curtis
Local time
Today, 11:49
Joined
Oct 22, 2004
Messages
1,187
Little problem here.... Trying to do some summing in a report, but can't find a method that works. This is a report of Sales Grouped by Salesman. The type of sale is one of two or three descriptions "Monthly", "One Time", so on...
So I have an unbound text box in my header "Monthly Sales" Now what I am trying to do is sum ONLY the "ContractPrice" fields that have description of "Monthly" And I would like to do this on the report if possible.... I have tried a IIF statement ... =IIf([TypeDescription]="Monthly",Sum([ContractPrice]),0)...
But the problem here is if ANY of the descriptions are "Monthly" it sums ALL "ContractPrice" fields.

Any thoughts????

Thanks
 
Nope........ error
"The expression you entered has a function containing the wrong number of arguments"
 
Sum(Iif([TypeDescription]="Monthly",[ContractPrice],0))
there were too many brackets after the Iif in the first example;)
 
Rich, you are the man! Was able to use this for a very similar situation, summing the totals of all contracts based on whether they were repeat customers or non-repeat. Thank you for this syntax!
 

Users who are viewing this thread

Back
Top Bottom