Jump to content
TNG Community

Reports needed for multiple/incorrect parent/children entries


Hemsearch

Recommended Posts

My database has 25 members working on it and it is natural that errors creep in with linking people together. After two recent sets of errors being discovered I’d like to create the following reports so that I can find where corrections are needed.

1 A report listing children whose mother was under the age of 18 at the birth (I found one woman who was supposedly mother to nine people born up to 200 years before she was).

2 A report listing people who apparently had two or more sets of parents.

Can anyone advise me how to do these.

Link to comment
Share on other sites

This is my absolute first attempt at subqueries, but I think this will show mothers under 18 years older than their children:

SELECT ext.personID, ext.gedcom, ext.famc, ext.lastname, ext.firstname, ext.birthdatetr
FROM /*adds the mothers personID*/(

SELECT ind.personID, ind.gedcom, ind.famc, ind.lastname, ind.firstname, ind.birthdatetr, fam.wife
FROM /*gets everyone in the children table*/(

SELECT children.personID, children.gedcom, people.famc, people.lastname, people.firstname, people.birthdatetr
FROM tng_children AS children, tng_people AS people
WHERE children.personID = people.personID && children.gedcom = 'Flint' && people.gedcom = 'yourtree'
) AS ind, tng_families AS fam
WHERE fam.familyID = ind.famc && fam.gedcom = 'yourtree'
) AS ext, tng_people AS people
WHERE people.personID = ext.wife && people.gedcom = 'yourtree' && year( ext.birthdatetr ) < ( year( people.birthdatetr ) +18 ) && ext.birthdatetr != ( 0000 -00 -00 ) && people.birthdatetr != ( 0000 -00 -00 )

You'll need to change the 3 'yourtree' entries to the name of your tree. the +18 can be changed to look for mothers that are a different age range. Note that this query only checks for 18 years from the year of birth, not the exact date.

If any of you SQL experts have something better, please let us know.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...