A week or two ago I posted some questions I had about some design issues I had in the DB design section. The problem was resolved and the DB design came along beautifully.
Unfortunatley, this grasshopper's query-fu is apparently significantly weaker than he had anticipated, because I can't get them to work right.
Here's the background: My employer receives allotments of funds from the Feds for distribution to rural businesses. Each allotment has several contracts that are issued to various businesses. Each contract will have several fund obligations for different amounts to said businesses for various purposes. Each of these obligations will have different disbursements/invoices over periods of time as each business receives sets amounts of funds for various purposes.
Example. We receive an allotment of $100k. We sign contracts with businesses X, Y, & Z. Each contract is for $25k, meaning we now have $25K in allotments left. Each company (X, Y, & Z) wants $10k from each of their contracts obligated to them for whatever purpose they are pursuing. Then, those $10k obligations will be disbursed in $5k chunks each month for the next two months. So now you see how the line process works: allotment -> contract -> obligation -> disbursement/invoice.
Now, I am trying to design queries which I can use for reports. Here is what I am trying to do, with the End result desired placed first, followed by the calculations to be used.
Total Unobligated Allotments = Allotment Amount - Total Obligations
Unliquidated Contracts = Obligation (per contract) - Total disbursements
I've tried everything I can think of, but it usually ends up with an error message along the lines of "You have tried to Execute a query that does not include XXXX as part of an aggregate function) or something like that.
What should I do?
ETA: Also, this is for ACCESS 2007