Question Locked

Access 2007 Report

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have trouble creating of SUM of a field with a condition. The expresion I'm using is:

=Sum(Iif([Accept),[Price],0))

I want to get a total of the prices, only if Accept = Yes. Accept is a Yes/No field. Price is Int.

I always get the following error message:

'You omitted an operand or operator, you entered an invalid character or comma, or you entered text without sorrounding it in quotation marks'

Any help?

3 replies

by thumbsup2

Without even looking up that formula to see what it needs, I can see your left/right brackets (round and square) don't match.

Look closely and you'll see it.

by aita montxo

Sorry I wrote it wrongly on the post .The actual formula is as follows:

=Sum(IIF([Accepted],[Price],0))

What I want is to get a result of all the prices that match Accepted to be true (Yes).

Any ideas on what is wrong with this?

This discussion is closed to new replies.