Report: families, ordered by husband's name

From TNG_Wiki
Jump to navigation Jump to search

Description: families, ordered by husband's name

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 familyID, h.personID AS HusbandPersonID, h.lastname AS Lastname1, h.firstname AS Firstname1, w.personID AS WifePersonID, w.lastname AS Lastname2, w.firstname AS Firstname2, f.living, f.gedcom FROM tng_families AS f LEFT JOIN tng_people AS h ON f.husband = h.personID LEFT JOIN tng_people AS w ON f.wife = w.personID ORDER BY h.lastname, h.firstname, h.personID, w.firstname, w.lastname, w.personID