Link to home
Start Free TrialLog in
Avatar of kauge
kauge

asked on

How do I create a conditional Sum in an Access Report

I'm trying to put a sum in a report in access which will total dollars in the field AMOUNT where the field NOTES does not equal "Duplicate" or "Revision"
 
Not sure how...any help would be appreciated.

Thanks,
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Try this in the control source of a textbox in the foooter of your report:

= ABS(SUM([Amount] * (Notes<> "Duplicate" AND Notes <> "Revision"))

Make sure that Amount and Notes are fieldnames, not control names
Avatar of kauge
kauge

ASKER

Now when I run the report the sum is $2,653.00...no matter what the total should be.  I can run it for one week or 10 weeks and the total is $2,653.00.  When I entered the syntax as you wrote...it stated I was missing a closing ) which I added.  Amount and Notes are field names.
Sorry...
Where did you add the missing paren? That could make a difference.  It should go at the end:

= ABS(SUM([Amount] * (Notes<> "Duplicate" AND Notes <> "Revision")))


Avatar of kauge

ASKER

That's where I put it.
ASKER CERTIFIED SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kauge

ASKER

Thank you so much!  That worked perfectly.
Glad to help out :-)