Report: Associations between people

From TNG_Wiki
Jump to navigation Jump to search

This report failed in TNG v8.1.1, due to a different table name. To correct, change 'tng_ass' to 'tng_associations' in the below SQL statement.

Description: Associations between people.

Copy and paste the text between the lines into the reports section below "OR Leave Display, Criteria and Sort fields blank and enter direct SQL SELECT statement here:" and give it the title you think is appropriate


SELECT p.personID, p.lastname AS lastname1, p.firstname AS firstname1, p.birthdate 
AS born1, p.living AS living1, p.gedcom, a.relationship AS Association, p2.personID 
AS Person2, p2.lastname AS lastname2, p2.firstname AS firstname2, p2.birthdate 
AS born2, p2.living AS living2, p2.gedcom
FROM tng_ass AS a
LEFT JOIN tng_people AS p ON ( a.personID = p.personID
AND a.gedcom = p.gedcom )
LEFT JOIN tng_people AS p2 ON ( a.passocID = p2.personID
AND a.gedcom = p2.gedcom )
WHERE p.living <>1
AND p2.living <>1
ORDER BY p.lastname, p.firstname, p.birthdatetr