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



SELECT

IIf([DBO_records].[Key_indicator]="O",[DBO_records].[org_name],[DBO_RECORDS].[FIRST_NAME] & " " & [DBO_RECORDS].[Last_Name]) AS Name, CCur([DBO_GiftSplit].[Amount]) AS Amount, DBO_GIFT.DTE AS [Date], DBO_FUND.DESCRIPTION, IIf([DBO_records_1].[Key_indicator]="O",[DBO_records_1].[org_name],[DBO_RECORDS_1].[FIRST_NAME] & " " & [DBO_RECORDS_1].[Last_Name]) AS [Tribute Name]



FROM

((DBO_GIFT_TRIBUTE INNER JOIN ((DBO_GiftSplit INNER JOIN ((DBO_CONSTIT_GIFTS INNER JOIN DBO_RECORDS ON DBO_CONSTIT_GIFTS.CONSTIT_ID = DBO_RECORDS.ID) INNER JOIN DBO_GIFT ON DBO_CONSTIT_GIFTS.GIFT_ID = DBO_GIFT.ID) ON DBO_GiftSplit.GiftId = DBO_GIFT.ID) INNER JOIN DBO_FUND ON DBO_GiftSplit.FundId = DBO_FUND.ID) ON DBO_GIFT_TRIBUTE.GIFT_ID = DBO_GIFT.ID) INNER JOIN DBO_TRIBUTE ON DBO_GIFT_TRIBUTE.TRIBUTE_ID = DBO_TRIBUTE.ID) INNER JOIN DBO_RECORDS AS DBO_RECORDS_1 ON DBO_TRIBUTE.RECORDS_ID = DBO_RECORDS_1.ID



ORDER BY

IIf([DBO_records].[Key_indicator]="O",[DBO_records].[org_name],[DBO_RECORDS].[Last_Name] & ", " & [DBO_RECORDS].[FIRST_NAME]), DBO_GIFT.DTE;
 

 

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.