=SUM(IIF..............not working

JCross

Registered User.
Local time
Today, 10:11
Joined
Feb 28, 2002
Messages
116
hi y'all -

I have a report control whose control source is:
=IIf([srptInventoryUsage(b)].[Report].[HasData]=-1,[srptInventoryUsage(b)].[Report]![SumOfUnitPrice],0)

because I needed it to return a value even if empty. Now, in the group footer I need to SUM this control...and I tried:

=SUM(IIf([srptInventoryUsage(b)].[Report].[HasData]=-1,[srptInventoryUsage(b)].[Report]![SumOfUnitPrice],0))

which ends up asking me for a value. and I tried:

=IIf(Sum([srptInventoryUsage(b)].[Report].[HasData]=-1,[srptInventoryUsage(b)].[Report]![SumOfUnitPrice],0))

Which says it has the wrong number of arguments. Can someone tell me how to do this??

p.s. - I also tried changing the runningsum property to Over Group, but it accumulated totals through groups instead of restarting on each new group.....

Thank you!

Jennifer

[This message has been edited by JCross (edited 04-08-2002).]

[This message has been edited by JCross (edited 04-08-2002).]
 
Thanks Pat,

The control is referencing another control on a subreport [srptInventoryUsage(b)] - and I initially tried NZ as the control source with no luck. I'll try again, but is there a way to use what I have (which currently works) and SUM it?

Ah yes - the reason the NZ didn't work for me and I used HasData is because the entire subreport would be empty, not just the control. So I need to SUM my HasData.

Jennifer


[This message has been edited by JCross (edited 04-09-2002).]

[This message has been edited by JCross (edited 04-09-2002).]
 
Sorry this wound up in two threads, but I found someone else with the same problem after I posted.

OK - It's a bit convoluted, but I added an invisible control to the Details, RunningSum OverGroup...and then made a visible control in the Footer referencing the invisible control. Not pretty, but it works. On to the next problem!!

Thanks for your help.

Jennifer
 

Users who are viewing this thread

Back
Top Bottom