Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Criteria and DSUM? 1

Status
Not open for further replies.

Cinfysue

Programmer
Sep 4, 2001
4
US
Hi, I need assistance with the following Microsoft Access query, please:

SELECT tblLoans.LoanID as ID, tblLoans.LastName as LastN, tblLoans.ProjDate, tblLoans.ProjAmt, [Enter Current Balance] AS OrigBal
FROM tblLoans;

I'd like to get a running total of ProjAmt column that takes the OrigBal (entered from user as criteria) and subtracts the first ProjAmt from that and then starts the running total in subsequent records.

ID LastN ProjDate ProjAmt Run Total
1 Smith 11/01/04 75000 OrigBal - ProjAmt(=R1)
2 Jones 11/05/04 80000 R1 - ProjAmt(=R2)
3 Limon 11/25/04 90000 R2 - ProjAmt(=R3)

and so on...


I've tried DSUM ("ProjectedWireAmt", "tblLoans") in the above query and am getting the overall running total and incorrect results.

Let me know what else I can provide and thank you very much!
 
Replace this:
DSUM ("ProjectedWireAmt", "tblLoans")
By this:
DSUM("ProjectedWireAmt", "tblLoans", "LoanID<=" & LoanID)

It is assumed that LoanID is in chronological order.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top