I'm having a problem building a query on a type I've not worked before. Here's the situation.
I have a field (we'll call this a FEE) within a table that contains multiple fees for a given loan number. I have another field (we'll call this a REMAINING AMOUNT) that contains an amount that I can use to remove those fee's. What I'm trying to figure out is how I can subtract each FEE from the REMAINING AMOUNT.
Normally if this was a constant 2 fee's I would know how to do this. However, there can be any number of fee's. I would like to avoid having to recreate a bunch of queries to eliminate the fee's. After I remove all of the fee's any remaining sum needs to extract from other amounts (in different tables). Is there an efficient way to do this? I'm rather stuck right now.
Any help would be greatly appreciated
LOAN FEE REMAINING AMOUNT
1234 30.22 100.00
1234 34.22 100.00
1234 18.54 100.00
1234 10.22 100.00
1239 05.22 100.00
1239 08.12 100.00