UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Help request on a query I'm having a problem with    
 
   
pappyb
post Aug 10 2006, 12:46 PM
Post #1

UtterAccess Addict
Posts: 130



Good morning,
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

Data Example

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
Go to the top of the page
 
+
ScottGem
post Aug 10 2006, 12:49 PM
Post #2

UtterAccess VIP / UA Clown
Posts: 25,090
From: LI, NY



Yes there is, it involves NOT storing calculated values which is generally a nono. The correct way to keep a balance is to use a transactions table that lists each transaction as either a credit or a debit. Then add all the credits and subtract all the debits.
Go to the top of the page
 
+
pappyb
post Aug 10 2006, 02:54 PM
Post #3

UtterAccess Addict
Posts: 130



Thanks for your reply Scott. I should have been more clear. Each fee has a code. Depending on if that fee is wiped out, I need to know those codes as they are being loaded into a different system. So if I can't wipe out all of the fee's I need to know which fee's were 0'd out. I hope I'm making sense with what I'm saying.
Go to the top of the page
 
+
ScottGem
post Aug 11 2006, 07:18 AM
Post #4

UtterAccess VIP / UA Clown
Posts: 25,090
From: LI, NY



I don't follow. Are you trying to debit the fees from a balance or determine whihc fees have not been charged?
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 24th May 2013 - 05:42 AM