FatBoySlim7
FatBoySlim7

Reputation: 232

MS access iif statement

I'm building a report in MS Access and got stuck on something. Basically what I'm doing is making a report that will display a list of clients on particular days. At the bottom of the report i do a total for Client count with this statement...

=(Sum([numclientsM]) & " M ; " )

Below that I'm trying to take an average for all reported days but i keep getting a weird error saying "CANNOT HAVE AGGREGATE FUNCTION IN EXPRESSION (AVG(SUM([numclientsM]))).

Here's what I'm trying to do here... Check if sum(numclientsM) is <> 0 then, if it is then give me average:

=IIf(Sum([numclientsM]<>0),Avg(Sum([numclientsM])),"0.0")

Upvotes: 0

Views: 285

Answers (1)

rafalg
rafalg

Reputation: 96

I can't check this at the moment, but try this:

=IIf(Sum([numclientsM])<>0,Avg([numclientsM]),"0.0")

Upvotes: 1

Related Questions