All pastes #939861 Raw Edit

Anonymous

public text v1 · immutable
·published 2008-03-12 17:03 UTC
rendered paste body
SELECT tblTransactions.TransactionDate, tblTransactions.TransactionDescription, tblTransactionDebits.DebitAmount, tblTransactionCredits.CreditAmount, aliDebitsAccount.AccountName, aliCreditsAccount.AccountName
FROM ((tblTransactions
INNER JOIN tblTransactionDebits ON tblTransactions.TransactionID=tblTransactionDebits.TransactionID)
INNER JOIN tblTransactionCredits ON tblTransactions.TransactionID=tblTransactionCredits.TransactionID) 
LEFT JOIN tblAccounts AS aliDebitsAccount ON tblTransactionDebits.AccountID=aliDebitsAccount.AccountID
LEFT JOIN tblAccounts AS aliCreditsAccount ON tblTransactionCredits.AccountID=aliCreditsAccount.AccountID;
.AccountID;