What is wrong with this formula?

W

WildlyHarry

=sum(IIf([desc]="rtn" And [Data]=0.01,Sum(IIf([desc]="hld" And
[Data]<>0.01,[Data],0)),0))
I am using the above formula to replace data. .01 is a place holder that
lets me know I need to replace it. When I try to preview my report I get the
following error.
"Cannot have aggregate function in expression Sum(IIf([desc]="rtn" And
[Data]=0.01,Sum(IIf([desc]="hld" And [Data]<>0.01,[Data],0)),0))."

Any thoughts on how to get this to work? Thanks in advance for your response.
 
J

Jeff C

Look at the IIF syntax:

IIF(This, Then, Else)

Get your iif statement to work and then add your Sum function.
 

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