I
Ian
I have a table called transactions. It's the same one as from the Ledger
template slightly modified.
I am trying to get a balance for all transactions prior to a certain date
(I need this on a report as the first line).
I have this query
*******************************************
Query1
SELECT Transactions.AccountID, Transactions.WithdrawalAmount,
Transactions.DepositAmount, Accounts.AccountTypeID,
Transactions.TransactionDate
FROM Accounts RIGHT JOIN Transactions ON Accounts.AccountID =
Transactions.AccountID
WHERE (((Accounts.AccountTypeID)=1) AND ((Transactions.TransactionDate)<#
9/1/2003#));
*******************************************
which returns the transactions for all accounts of type 1 before the date
(I will eventually get the date from a form).
and Query 2 to create the balance
*******************************************
SELECT Query1.AccountID, Sum([Query1]![WithdrawalAmount])-Sum([Query1]!
[DepositAmount]) AS Balance
FROM Query1
GROUP BY Query1.AccountID;
*******************************************
Is this the only way of doing it?
template slightly modified.
I am trying to get a balance for all transactions prior to a certain date
(I need this on a report as the first line).
I have this query
*******************************************
Query1
SELECT Transactions.AccountID, Transactions.WithdrawalAmount,
Transactions.DepositAmount, Accounts.AccountTypeID,
Transactions.TransactionDate
FROM Accounts RIGHT JOIN Transactions ON Accounts.AccountID =
Transactions.AccountID
WHERE (((Accounts.AccountTypeID)=1) AND ((Transactions.TransactionDate)<#
9/1/2003#));
*******************************************
which returns the transactions for all accounts of type 1 before the date
(I will eventually get the date from a form).
and Query 2 to create the balance
*******************************************
SELECT Query1.AccountID, Sum([Query1]![WithdrawalAmount])-Sum([Query1]!
[DepositAmount]) AS Balance
FROM Query1
GROUP BY Query1.AccountID;
*******************************************
Is this the only way of doing it?