Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sum with multiple criteria

Status
Not open for further replies.

ptrifile

Technical User
Aug 10, 2004
457
US
I have a report where I am summing the count of a field based on another fields criteria. I cam currently using the following successful:

Code:
=Sum(IIf([released_by]="NAME" ,[countoftrans_NO],0))

This works fine, but I need to add additional criteria to the "released_by". I have tried "Name" and "other" and also tried "Name" or "other" and it does not seem to show the desired results. How can I modify this so that I can count the "countoftrans_no" by multiple criteria of "released_by"?

Any help is appreciated.

Thank you,

Paul
 
Hi,

How about this?
Code:
=Sum(IIf([released_by]="NAME" Or [released_by]="other" ,[countoftrans_NO],0))

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein
 
I would probably use the IN() condition.


Code:
=Sum(Abs([released_by] In ("NAME","other"))*[countoftrans_NO])

Ideally there should be some value in the released_by lookup table that identifies whether or not a value should be included in the Sum().

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top