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

Summing with a condition

Status
Not open for further replies.

RLA

Instructor
Feb 22, 2002
22
US
Hi, please help!
I'm trying to write a report which lists all transactions by transaction code. This part is easy -- I sorted by code, listed the transaction info in the detail section, and summed the information in the group footer. However, I would also like to include a figure in the group footer w/ a sum and a condition -- in other words, sum all transactions with a certain date. If I were using DSum it would be easy, but b/c the report is tied to a specific query and b/c I'd like to do this in the footer, so it appears for all transaction codes, it's hard. Any ideas?

Thanks very much!
 
Can not you use DSUM against the query with a criteria?

=Dsum("GuyYouWantSummed", "QueryName", "QueryName!GuyYouWantSummed = " & {condition} )

Or add a calculated expression to your query that grabs the transaction sum IF the date is appropriate otherwise it's zero, and then sum that guy?

SumIWant: IIF(TransDate = #03/14/03#, TransSum, 0)

If you SUM the SUMIWANT guy, it should give you what you want.

J Me? Ambivalent? Well, yes and no....
Another free Access forum:
More Access stuff at
 
Hi,
I wrote an FAQ on the topic of how to use the DSUM function. faq703-3066 HTH, [pc2]
Randy Smith
California Teachers Association
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top