All right. I am SO glad that Libreoffice Base has code modules, because that's what I'm going to need to solve this particular problem.
At Issue: I need to generate a query based on a prioritized list of expenses. For a given settlement, I want to display how much money is going into various accounts based on that expense list. I want nothing more added up than the settlement can cover. Say I have $1000 in expenses but only a $750 settlement. I want to know exactly what that $750 can cover. At first I thought it only take a nested query, but I can't figure out how it can add up expense amounts till a certain limit is reached. But still...
- Create a query containing only the priority number and the expense amount.
- Start a counting loop that adds up the expense amounts until that limit is reached. Note the priority number.
- Create a second query from the expense list containing only the records that have a priority number equal to or less than the one generated from the first query.
- Using that query, sum up the amounts going into each account, and display them, and list what expenses are being covered.
There. No biggie, right? Only it means learning an entirely new programming language. But...you learn one, others tend to come pretty easily.