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



Please note that this query is also looking for a specific attribute which is a table, which is why it is linked to just the TableEntries_1 table.



SELECT

DBO_RECORDS.FULL_NAME, DBO_EDUCATION.DATE_GRADUATED, STATUS.LONGDESCRIPTION, DBO_EDUCATION.DATE_GRADUATED, DBO_TABLEENTRIES_1.LONGDESCRIPTION, DBO_AttributeTypes.DESCRIPTION



FROM

(((((DBO_RECORDS LEFT JOIN DBO_CONSTITUENT_CODES ON DBO_RECORDS.ID = DBO_CONSTITUENT_CODES.CONSTIT_ID) LEFT JOIN DBO_TABLEENTRIES ON DBO_CONSTITUENT_CODES.CODE = DBO_TABLEENTRIES.TABLEENTRIESID) LEFT JOIN DBO_EDUCATION ON DBO_RECORDS.ID = DBO_EDUCATION.RECORD_ID) LEFT JOIN DBO_TABLEENTRIES AS STATUS ON DBO_EDUCATION.STATUS = STATUS.TABLEENTRIESID) LEFT JOIN (DBO_EducationAttributes LEFT JOIN DBO_TABLEENTRIES AS DBO_TABLEENTRIES_1 ON DBO_EducationAttributes.TABLEENTRIESID = DBO_TABLEENTRIES_1.TABLEENTRIESID) ON DBO_EDUCATION.ID = DBO_EducationAttributes.PARENTID) LEFT JOIN DBO_AttributeTypes ON DBO_EducationAttributes.ATTRIBUTETYPESID = DBO_AttributeTypes.ATTRIBUTETYPESID



WHERE

(((STATUS.LONGDESCRIPTION)="enrolled") AND ((DBO_TABLEENTRIES.LONGDESCRIPTION)="Student") AND ((DBO_AttributeTypes.DESCRIPTION)="Clubs"));

 

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.