ClaraBarton
Registered User.
- Local time
- Yesterday, 22:11
- Joined
- Oct 14, 2019
- Messages
- 606
Code:
SELECT qryTransactions.TransactionID,
qryTransactions.Cleared,
Nz(-[Credit],0)+Nz([debit],0) AS CkAmount,
-Nz([CatCredit],0)+Nz([CatDebit],0) AS CatAmount,
qryTransfers.TAmount,
Sum(IIf([Cleared]=True,+[CkAmount],0)) AS ClearedAmt,
Sum(Nz([CkAmount],0)-Nz([CatAmount],0)+Nz([TAmount],0)) AS Remaining
FROM (qryTransactions LEFT JOIN tblCheckCat ON qryTransactions.TransactionID = tblCheckCat.fTransactionID) LEFT JOIN qryTransfers ON qryTransactions.TransactionID = qryTransfers.TTransID
GROUP BY qryTransactions.TransactionID,
qryTransactions.Cleared,
Nz(-[Credit],0)+Nz([debit],0),
-Nz([CatCredit],0)+Nz([CatDebit],0),
qryTransfers.TAmount;
I would like for Transaction19 to return 10 in the ClearedAmt and 10 in the Remaining which is what's happening in TransID 21.
What is the difference?