Note: This code is written and intended for use in Microsoft Access and will not work in the SQL Server Query Analyzer.
Below is code used to locate the Daughter relationships for Robert Hernandez in the sample database:
DBO_RECORDS.ID, DBO_TABLEENTRIES.LONGDESCRIPTION, DBO_RECORDS_1.FIRST_NAME
((DBO_RECORDS INNER JOIN DBO_CONSTIT_RELATIONSHIPS ON DBO_RECORDS.ID = DBO_CONSTIT_RELATIONSHIPS.CONSTIT_ID) INNER JOIN DBO_TABLEENTRIES ON DBO_CONSTIT_RELATIONSHIPS.RELATION_CODE = DBO_TABLEENTRIES.TABLEENTRIESID) INNER JOIN DBO_RECORDS AS DBO_RECORDS_1 ON DBO_CONSTIT_RELATIONSHIPS.RELATION_ID = DBO_RECORDS_1.ID
(((DBO_RECORDS.ID)=280) AND ((DBO_TABLEENTRIES.LONGDESCRIPTION)="Daughter"));
For instructions on how to do this in ASA, refer to How to write a SQL Statement in ASA that will find selected relationships (BB54824)
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.