Problem Sum Code

B

Brennan

Hello:

I am using the following code in a report text box to sum
the values in a field when a certain value is present:

=Sum(If[tblBids_BidStatus] = "GC-Awarded CMR Lost" Or "GC-
Awarded CMR Awarded", [tblBids_BidAmount],0)))

My problem is that the code appears to be ignoring the
Status field and is calculating a sum without evaluating
the conditions.

Any comments or suggestions would be appreciated.

Thanks
Brennan
 
D

Duane Hookom

Your code should generate multiple errors. You have only 1 "(" and 3 ")"s.
There is no If function. You should copy and paste your exact expressions
from Access into your postings to elimate typos.
Try:
=Sum(IIf([tblBids_BidStatus] = "GC-Awarded CMR Lost" Or [tblBids_BidStatus]
= "GC-Awarded CMR Awarded", [tblBids_BidAmount],0))
or
=Abs(Sum(([tblBids_BidStatus] = "GC-Awarded CMR Lost" Or [tblBids_BidStatus]
= "GC-Awarded CMR Awarded") * [tblBids_BidAmount]))
 

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