Report: Create a view of families marked living

From TNG_Wiki
Jump to navigation Jump to search

Description: Create a view of families marked living


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


CREATE VIEW famliving AS SELECT h.lastname as fName, concat(h.title, ' ', h.firstname, ' ', h.suffix) 
AS hfName, f.marrdate, w.lastname AS wfName, concat(w.title, ' ', w.firstname, ' ', w.suffix) 
AS wlName, f.familyID as FamilyID FROM tng_families f INNER JOIN tng_people h on f.gedcom = h.gedcom 
and f.husband = h.personID INNER JOIN tng_people w on f.gedcom = w.gedcom and f.wife = w.personID 
WHERE f.living = "1" AND h.living = "0" AND w.living = "0" ORDER BY f.marrdatetr