Greetings:
I have written a specialized accounting application, but I'm having trouble with a report my clients want. Here's the setup:
- The company has multiple Divisions, stored in tblDivisions.
- Each Division has multiple Suppliers, stored in tblSuppliers.
- Each Supplier has a Budget for each calendar year, stored in tblCategoryBudgets.
- Each Budget has multiple Transactions posted against specific Categories, stored in tblTransactions.
I'm trying to create a query that will be the basis for an Expense Report by Division and Category. The Transactions total up fine, but I can't figure out how to make the Budget add up. Here is an example:
Division = "Beer" (seriously)
Suppliers = "Coors, Miller, Samuel Adams"
Categories = "Free goods, glassware, media"
The client wants to total the expenses for "free goods" for all three suppliers, AND, on the same line, to total up the "free goods" budget for all three suppliers. Coors may have 12 $50 expenses posted against "free goods" and the total shows up fine. But its "free goods" budget shows up on each Coors transaction record. If their free goods budget was $1000, it would show up as $12000. If I were working with one supplier, I could divide by 12 and display that has the total expense, but Miller might have a $1500 free goods budget and 10 transactions at $50. What I'm getting is:
Free Goods
Expenses: $1100 Budget: $27000
What I need to show is:
Free Goods
Expenses: $1100 Budget: $2500
Any idea how I can get this result? TIA
Keith
I have written a specialized accounting application, but I'm having trouble with a report my clients want. Here's the setup:
- The company has multiple Divisions, stored in tblDivisions.
- Each Division has multiple Suppliers, stored in tblSuppliers.
- Each Supplier has a Budget for each calendar year, stored in tblCategoryBudgets.
- Each Budget has multiple Transactions posted against specific Categories, stored in tblTransactions.
I'm trying to create a query that will be the basis for an Expense Report by Division and Category. The Transactions total up fine, but I can't figure out how to make the Budget add up. Here is an example:
Division = "Beer" (seriously)
Suppliers = "Coors, Miller, Samuel Adams"
Categories = "Free goods, glassware, media"
The client wants to total the expenses for "free goods" for all three suppliers, AND, on the same line, to total up the "free goods" budget for all three suppliers. Coors may have 12 $50 expenses posted against "free goods" and the total shows up fine. But its "free goods" budget shows up on each Coors transaction record. If their free goods budget was $1000, it would show up as $12000. If I were working with one supplier, I could divide by 12 and display that has the total expense, but Miller might have a $1500 free goods budget and 10 transactions at $50. What I'm getting is:
Free Goods
Expenses: $1100 Budget: $27000
What I need to show is:
Free Goods
Expenses: $1100 Budget: $2500
Any idea how I can get this result? TIA
Keith