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 field based on multiple criteria 1

Status
Not open for further replies.

BradCollins

Technical User
Sep 2, 2003
116
AU
I am trying to get the sum of a particular field in my report, in the report footer I have

=DSum("[fldORAmount]","qryORReportData","[fldORCategory] = 'Cash (over/under)'")

and this works fine, however I would also like a total placed in the Employee Footer. I have in the detail section multiple values of "[fldORCategory]", what I would like to do is get the total value of just one of those values, but unlike the above line (from the report footer) not for everyone, but for only the listed employee.
I hope O have explained this right. An example of the report would look like this :

Employee#1
1 Jan 2006
Cat1 $2.00
Cat2 $2.00
Cat3 $2.00
2 Jan 2006
Cat1 $2.00
Cat2 $2.00
Cat3 $2.00
3 Jan 2006
Cat1 $2.00
Cat2 $2.00
Cat3 $2.00

Total = $18.00
Total for Cat3 = $6.00

Employee#2
1 Jan 2006
Cat1 $1.00
Cat2 $1.00
Cat3 $1.00
2 Jan 2006
Cat1 $1.00
Cat2 $1.00
Cat3 $1.00
3 Jan 2006
Cat1 $1.00
Cat2 $1.00
Cat3 $1.00

Total = $9.00
Total for Cat3 = $3.00

Grand Totals : $27.00
Grand Total for Cat3 = $9.00


it is the above highlighted line that I cannot do, any ideas are most welcome.

Thanks
 
thanks anyway, but I have finally worked it out.

if anyone is interested the answer was

=Sum(IIf([fldORCategory]="Cash (over/under)",[fldORAmount],0))

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top