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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sum Help 911

Status
Not open for further replies.

jurgen

Programmer
Feb 8, 2001
209
BE
I've a report that is base on a query it groups by location and then by customer, there are 2 kinds of transactions ordered on date. Now I want to make the total by location of all customers for transaction 1 and 2 in seperate fields, and the total by customer in the same way

Anyone any idea, i tried dsum but I think i did it wrong

JJ
 
If I understand correctly what you are trying to do, I would create two new calculated fields in the query. One that gets populated for one kind of transaction and another that gets populated fro the other kind of transaction. Let's say you have a trx_type field to indicate the type of transaction. Then, you could create the two following calculated fields:

trx1amt: iif(trx_type = '1', trx_amt, 0)
this would be the amount only for trx type 1's

trx2amt: iif(trx_type = '2', trx_amt, 0)
this would be the amount only for trx type 2's

then sum these two fields over your groups....
J. Jones
jjones@cybrtyme.com
 
Your the greatest thnx

It works just how I want

JJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top