Much appreciated if the following two sql's can be combined into one, maybe by sub query.
StatementID is the common field.
tblBankStatements is the Header and holds a value which should be the Total Deposits for the day.
tblMemberRepayments holds the detail and when summed, should equal the value in tblBankStatements.
(The two fields provide a check to ensure all repayment records are entered correctly)
I want one sql that can give me a record for each date (tblBankStatements) with the two values showing, One of them the Summed value (1st sql above) and the other the entered value in tblBankStatements.
StatementID is the common field.
Code:
SELECT tblMemberRepayments.StatementID, Sum(tblMemberRepayments.PaymentAmt) AS SumOfPaymentAmt
FROM tblMemberRepayments
GROUP BY tblMemberRepayments.StatementID;
Code:
SELECT tblBankStatements.StatementID, tblBankStatements.BankID, tblBankStatements.StatementDate, tblBankStatements.StatementAmt, tblBankStatements.ApprovalFlag
FROM tblBankStatements;
tblBankStatements is the Header and holds a value which should be the Total Deposits for the day.
tblMemberRepayments holds the detail and when summed, should equal the value in tblBankStatements.
(The two fields provide a check to ensure all repayment records are entered correctly)
I want one sql that can give me a record for each date (tblBankStatements) with the two values showing, One of them the Summed value (1st sql above) and the other the entered value in tblBankStatements.