Microsoft SQL Query:

SELECT
AP7VENDORS.VENDORNAME AS Vendor, AP7INVOICES.INVOICENUMBER AS [Invoice Number], AP7INVOICES.INVOICEAMOUNT AS Amount, GL7ACCOUNTS.ACCOUNTNUMBER AS [DR Account #]

FROM
AP7INVOICEDISTRIBUTION
LEFT JOIN GL7ACCOUNTS ON AP7INVOICEDISTRIBUTION.GL7ACCOUNTSID = GL7ACCOUNTS.GL7ACCOUNTSID
RIGHT JOIN (AP7INVOICES INNER JOIN AP7VENDORS ON AP7INVOICES.AP7VENDORSID = AP7VENDORS.AP7VENDORSID) ON AP7INVOICEDISTRIBUTION.PARENTID = AP7INVOICES.AP7INVOICESID

WHERE
AP7INVOICEDISTRIBUTION.TRANSACTIONTYPE=1

ORDER BY
AP7VENDORS.VENDORNAME


Microsoft Access Query:


SELECT

dbo_AP7VENDORS.VENDORNAME AS Vendor, dbo_AP7INVOICES.INVOICENUMBER AS [Invoice Number], dbo_AP7INVOICES.INVOICEAMOUNT AS Amount, dbo_GL7ACCOUNTS.ACCOUNTNUMBER AS [DR Account #]

FROM

(dbo_AP7INVOICEDISTRIBUTION LEFT JOIN dbo_GL7ACCOUNTS ON dbo_AP7INVOICEDISTRIBUTION.GL7ACCOUNTSID = dbo_GL7ACCOUNTS.GL7ACCOUNTSID) RIGHT JOIN (dbo_AP7INVOICES INNER JOIN dbo_AP7VENDORS ON dbo_AP7INVOICES.AP7VENDORSID = dbo_AP7VENDORS.AP7VENDORSID) ON dbo_AP7INVOICEDISTRIBUTION.PARENTID = dbo_AP7INVOICES.AP7INVOICESID

WHERE

(((dbo_AP7INVOICEDISTRIBUTION.TRANSACTIONTYPE)=1))

ORDER BY

dbo_AP7VENDORS.VENDORNAME;

Disclaimer: Blackbaud provides 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. Blackbaud 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.