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.LAST_NAME, dbo_RECORDS_1.LAST_NAME, dbo_RECORDS.ORG_NAME, dbo_RECORDS.ID, dbo_TABLEENTRIES.LONGDESCRIPTION, dbo_TABLEENTRIES_1.LONGDESCRIPTION

FROM ((dbo_ConstituentAttributes INNER JOIN dbo_TABLEENTRIES ON dbo_ConstituentAttributes.TABLEENTRIESID = dbo_TABLEENTRIES.TABLEENTRIESID) INNER JOIN (dbo_RECORDS INNER JOIN (dbo_CONSTIT_RELATIONSHIPS INNER JOIN dbo_RECORDS AS dbo_RECORDS_1 ON dbo_CONSTIT_RELATIONSHIPS.RELATION_ID = dbo_RECORDS_1.ID) ON dbo_RECORDS.ID = dbo_CONSTIT_RELATIONSHIPS.CONSTIT_ID) ON dbo_ConstituentAttributes.PARENTID = dbo_RECORDS.ID) INNER JOIN (dbo_ConstituentAttributes AS dbo_ConstituentAttributes_1 INNER JOIN dbo_TABLEENTRIES AS dbo_TABLEENTRIES_1 ON dbo_ConstituentAttributes_1.TABLEENTRIESID = dbo_TABLEENTRIES_1.TABLEENTRIESID) ON dbo_RECORDS_1.ID = dbo_ConstituentAttributes_1.PARENTID

WHERE (((dbo_TABLEENTRIES.LONGDESCRIPTION)="Basketball") AND ((dbo_TABLEENTRIES_1.LONGDESCRIPTION)="Basketball"));

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.