There are times when you may need to obtain a list of parents and student IDs for use in reports/exports or with other applications.  The below is an example that surfaces the System Record ID, the Record ID, and the relationship of parents/students and is one way this can be accomplished with RODBA:
 
SELECT 
  individuals.EA7INDIVIDUALSID as 'Parent System Record ID',
  parentrecords.USERDEFINEDID as 'Parent Record ID',
  parentrecords.LASTNAME AS PARENTLAST, 
  parentrecords.FIRSTNAME AS PARENTFIRST, 
  relationcode.DESCRIPTION AS Relation, 
  students.EA7STUDENTSID as 'Student System Record ID',
  studentrecords.USERDEFINEDID as 'Student ID',
  studentrecords.LASTNAME AS STUDENTLAST, 
  studentrecords.FIRSTNAME AS STUDENTFIRST, 
  recipcode.DESCRIPTION AS Reciprocal
  
FROM dbo.EA7RELATIONSHIPS AS relationships
  INNER JOIN dbo.EA7RECORDS AS studentrecords ON relationships.PARENTID = studentrecords.EA7RECORDSID
  INNER JOIN dbo.EA7STUDENTS AS students ON students.EA7RECORDSID = studentrecords.EA7RECORDSID 
  INNER JOIN dbo.EA7RECORDS AS parentrecords ON relationships.RELATIONID = parentrecords.EA7RECORDSID 
  INNER JOIN dbo.EA7INDIVIDUALS AS individuals ON individuals.EA7RECORDSID = parentrecords.EA7RECORDSID
  INNER JOIN dbo.TABLEENTRIES AS recipcode ON relationships.RECIPROCALCODE = recipcode.TABLEENTRIESID 
  INNER JOIN dbo.TABLEENTRIES AS relationcode ON relationships.RELATIONSHIPCODE = relationcode.TABLEENTRIESID 
  
WHERE 
  relationships.PARENTIDTYPE = 1
ORDER BY 
  studentrecords.LASTNAME



RODBA 
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.