Report: individuals married with age younger than 18 years

From TNG_Wiki
Jump to: navigation, search

Description: individuals married with age <= 18 years and marriage date AFTER 1785 (you can change both the year 1785 and the age threshold.)

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.gedcom, p.lastname, p.firstname, p.sex, p.birthdate, f.marrdate, p.deathdate, f.familyID, 
  YEAR(f.marrdatetr)-YEAR(p.birthdatetr) AS age_at_marriage, p.living, f.gedcom 
 FROM tng_people AS p LEFT JOIN tng_families AS f ON p.personID=f.husband and p.gedcom=f.gedcom
 WHERE (f.marrdatetr-p.birthdatetr>0) AND (YEAR(f.marrdatetr)-YEAR(p.birthdatetr)<=18) and YEAR(p.birthdatetr)>1785 
 UNION SELECT p.personID, p.gedcom, p.lastname, p.firstname, p.sex, p.birthdate, f.marrdate, p.deathdate, f.familyID, 
  YEAR(f.marrdatetr)-YEAR(p.birthdatetr) AS age_at_marriage, p.living, f.gedcom FROM tng_people AS p 
 LEFT JOIN tng_families AS f ON p.personID=f.wife and p.gedcom=f.gedcom 
 WHERE (f.marrdatetr-p.birthdatetr>0) and YEAR(p.birthdatetr)>1785 AND (YEAR(f.marrdatetr)-YEAR(p.birthdatetr)<=18) 
 ORDER BY age_at_marriage, lastname, firstname, personID