Report: Wrong place names for FAMIILIES

From TNG_Wiki
Jump to navigation Jump to search

Description: Places to families, which are NOT in the places table (check for data plausibility)


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, husband, wife, "Place of marriage" 
AS Kind_of_place, marrplace AS Entered_place_name, f.gedcom FROM tng_families 
AS f LEFT JOIN tng_places AS pl ON (f.marrplace=pl.place AND f.gedcom=pl.gedcom) 
WHERE ISNULL(place) AND marrplace<>"" UNION SELECT familyID, husband, wife, "Place of divorce" 
AS Kind_of_place, divplace AS Entered_place_name, f.gedcom FROM tng_families 
AS f LEFT JOIN tng_places AS pl ON (f.divplace=pl.place AND f.gedcom=pl.gedcom) 
WHERE ISNULL(place) AND divplace<>"" ORDER BY CAST(SUBSTRING(familyID, 2) AS UNSIGNED)