Problem Sum Code

  • Thread starter Thread starter Brennan
  • Start date Start date
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
 
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]))
 
Back
Top