Note: This code is written and intended for use in Microsoft Access and will not work in the SQL Server Query Analyzer.



SELECT

dbo_GL7TRANSACTIONS.POSTDATE, dbo_GL7TRANSACTIONS.TRANSACTIONNUMBER AS TransactionID,

dbo_TABLEENTRIES_1.DESCRIPTION AS Journal, dbo_GL7TRANSACTIONS.REFERENCE,

IIf([TRANSACTIONTYPE]=1,"Debit","Credit") AS TransType, dbo_GL7ACCOUNTS.ACCOUNTNUMBER,

dbo_GL7TRANSACTIONS.AMOUNT AS TotalAmount, dbo_GL7PROJECTS.PROJECTID, dbo_GL7PROJECTS.DESCRIPTION,

dbo_TABLEENTRIES_2.DESCRIPTION, dbo_TABLEENTRIES.DESCRIPTION AS TransactionCode1,

dbo_GL7TRANSACTIONDISTRIBUTIONS.AMOUNT as DistributedAmount

FROM

(((((dbo_GL7TRANSACTIONS INNER JOIN dbo_GL7ACCOUNTS ON

dbo_GL7TRANSACTIONS.GL7ACCOUNTSID = dbo_GL7ACCOUNTS.GL7ACCOUNTSID) INNER JOIN

dbo_GL7TRANSACTIONDISTRIBUTIONS ON

dbo_GL7TRANSACTIONS.GL7TRANSACTIONSID = dbo_GL7TRANSACTIONDISTRIBUTIONS.GL7TRANSACTIONSID) INNER JOIN

dbo_GL7PROJECTS ON dbo_GL7TRANSACTIONDISTRIBUTIONS.GL7PROJECTSID = dbo_GL7PROJECTS.GL7PROJECTSID) INNER JOIN

dbo_TABLEENTRIES ON dbo_GL7TRANSACTIONDISTRIBUTIONS.TRANSACTIONCODE1 = dbo_TABLEENTRIES.TABLEENTRIESID) INNER JOIN

dbo_TABLEENTRIES AS dbo_TABLEENTRIES_1 ON dbo_GL7TRANSACTIONS.JOURNAL = dbo_TABLEENTRIES_1.TABLEENTRIESID) INNER JOIN

dbo_TABLEENTRIES AS dbo_TABLEENTRIES_2 ON dbo_GL7TRANSACTIONDISTRIBUTIONS.CLASS = dbo_TABLEENTRIES_2.TABLEENTRIESID

WHERE

(((dbo_GL7TRANSACTIONS.POSTDATE)>=CDate("01/01/2004")));

Disclaimer: We provide programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes you are familiar with Structured Query Language and the tools used to create and modify SQL statements and Crystal Reports. Our Customer Support may help explain the functionality of a particular procedure, but we will not modify, or assist you with modifying, these examples to provide additional functionality.