Problematic families

From TNG_Wiki
Jump to navigation Jump to search

Problematic families

Description: Families where the wife or husband was not successfully deleted or removed, causing problems in creating gedcoms. Copy and paste the text between the lines into the 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, p.firstname, p.sex, p.birthdate, p.deathdate, f.marrdate, f.familyID, f.gedcom
FROM tng_people AS p
LEFT JOIN tng_families AS f ON p.personID = f.husband
WHERE (
p.lastname IS NULL
)
OR (
p.firstname IS NULL
)
OR p.lastname = ""
OR p.firstname = ""
or p.personID = NULL
or p.personID = ""
UNION SELECT p.personID, p.lastname, p.firstname, p.sex, p.birthdate, p.deathdate, f.marrdate, f.familyID, f.gedcom
FROM tng_people AS p
LEFT JOIN tng_families AS f ON p.personID = f.wife
WHERE (
p.lastname IS NULL
)
OR (
p.firstname IS NULL
)
OR p.lastname = ""
OR p.firstname = ""
or p.personID = NULL
or p.personID = ""
ORDER BY lastname, firstname, personID