Can anyone help me with this expression?
I have a report linked to a query with the following fields bieng pulled
from various tables:
[NRP] Currency: Non Recurring Price
[#] Number: Quantity
[TDAPP] Yes (0)/No(-1): Term Discount Applicable
In the report I have created the following calculated fields:
[TotalNRP] = [NRP]* [#]
[TDNRP] =IIf([TDAPP]="-1",[NRP]*[#],"0")
Both of which perform well. My problem is I need to total the TDNRP column
of the report.
I tried creating a new field called [TotalTDNRP] =sum
(IIf([TDAPP]="-1",[NRP]*[#],"0")) and it didn’t work.
Any help would be greatly appreciated.
Many thanks, David.
Ofer Cohen - 12 Jul 2007 06:52 GMT
What do you get? Error or wrong resault?
Does this formula works when not trying to sum on it?
Any way, check the followings:
1. Yes/No fields and numbers don't need double quotes, try:
sum(IIf([TDAPP]=True,[NRP]*[#],0))
2. Check for Nulls
sum(IIf([TDAPP]=True,Nz([NRP],0)*Nz([#],0),0))
3. Make sure the text box where this formula located in doesnt have the
name: TDAPP, NRP, [#]
4. The Sum need to be on the Report Footer and not the PageFooter, it won't
work on the page footer

Signature
Good Luck
BS"D
> Can anyone help me with this expression?
>
[quoted text clipped - 18 lines]
>
> Many thanks, David.