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


SELECT

dbo_RECORDS.FIRST_NAME, dbo_RECORDS.LAST_NAME, dbo_RECORDS.ORG_NAME, dbo_GiftSplit.Amount, dbo_RECORDS_1.FIRST_NAME, dbo_RECORDS_1.LAST_NAME, dbo_RECORDS_1.ORG_NAME, dbo_GiftSplit_1.Amount, dbo_GIFT_1.DTE, dbo_CONSTIT_GIFTS.FLAGS



FROM dbo_GiftSplit AS dbo_GiftSplit_1 INNER JOIN ((dbo_CONSTIT_GIFTS AS dbo_CONSTIT_GIFTS_1 INNER JOIN ((dbo_InstallmentPayment INNER JOIN (dbo_Installment INNER JOIN (dbo_GiftSplit INNER JOIN ((dbo_RECORDS INNER JOIN dbo_CONSTIT_GIFTS ON dbo_RECORDS.ID = dbo_CONSTIT_GIFTS.CONSTIT_ID) INNER JOIN dbo_GIFT ON dbo_CONSTIT_GIFTS.GIFT_ID = dbo_GIFT.ID) ON dbo_GiftSplit.GiftId = dbo_GIFT.ID) ON dbo_Installment.PledgeId = dbo_GIFT.ID) ON dbo_InstallmentPayment.InstallmentId = dbo_Installment.InstallmentId) INNER JOIN dbo_GIFT AS dbo_GIFT_1 ON dbo_InstallmentPayment.PaymentId = dbo_GIFT_1.ID) ON dbo_CONSTIT_GIFTS_1.GIFT_ID = dbo_GIFT_1.ID) INNER JOIN dbo_RECORDS AS dbo_RECORDS_1 ON dbo_CONSTIT_GIFTS_1.CONSTIT_ID = dbo_RECORDS_1.ID) ON dbo_GiftSplit_1.GiftId = dbo_GIFT_1.ID



WHERE (((dbo_RECORDS.CONSTITUENT_ID)<>[dbo_RECORDS_1].[CONSTITUENT_ID]) AND ((dbo_CONSTIT_GIFTS_1.FLAGS)=0) AND ((dbo_CONSTIT_GIFTS.FLAGS)<>16))

ORDER BY dbo_RECORDS.LAST_NAME;

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.