Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#2790 Error for youngest male or female in statistics

open
None
5
2010-03-04
2010-02-28
fa0850-fa0850
No

In the statistics page can be failures to find the man or woman who had married the youngest. The error stems from the fact that his baptism took place several years after birth and baptism happens before birth.

Discussion

  • fa0850-fa0850
    fa0850-fa0850
    2010-03-03

    class_stats.php

     
    Attachments
  • fa0850-fa0850
    fa0850-fa0850
    2010-03-03

    Here is a fix that corrects the bug that might be encountered if the date of baptism is close to that of marriage. it occurs in the top statistical age of youngest man or woman at her wedding

     
  • KosherJava
    KosherJava
    2010-03-04

    • assigned_to: nobody --> wooc
     
  • It doesn't work on my system.
    The query never ends.

     
  • fa0850-fa0850
    fa0850-fa0850
    2010-03-07

    could you try this command on sql remplacing 1 by the file number on our database :
    SELECT fam.f_id AS famid,fam.f_wife,
    indi.i_id AS i_id,
    indi.i_gedcom as id_gedcom,
    birth.d_year as b_year,
    birth_act.d_year as ba_year,
    married.d_year as m_year,
    married.d_year-birth.d_year as age
    FROM pgv_families AS fam
    LEFT JOIN pgv_dates AS birth ON birth.d_file = 1 and birth.d_fact = 'BIRT'
    LEFT JOIN pgv_dates AS birth_act ON birth_act.d_file = 1 and birth_act.d_fact IN ('CHR', 'BAPM', '_BRTM')
    LEFT JOIN pgv_dates AS married ON married.d_file = 1 and married.d_fact = 'MARR'
    LEFT JOIN pgv_individuals AS indi ON indi.i_file = 1
    WHERE ((birth.d_gid = indi.i_id) and (birth_act.d_gid = indi.i_id) and (birth.d_gid=birth_act.d_gid) ) AND
    married.d_gid = fam.f_id AND
    indi.i_id = fam.f_wife AND
    fam.f_file = 1 AND
    ((birth.d_year <> 0) OR (birth_act.d_year <> 0)) AND
    ((married.d_year > birth.d_year) OR (married.d_year > birth_act.d_year)) AND
    birth.d_year <= birth_act.d_year AND
    i_sex='F'
    ORDER BY married.d_year-birth.d_year Asc

     
  • This query doesn't include people who have only BIRT record and don't have CHR\BAPM\_BRTM

     
  • Try this:
    "SELECT fam.f_id AS famid,fam.{$sex_field},
    indi.i_id AS i_id,
    indi.i_gedcom as id_gedcom,
    birth.d_julianday1 as b_year,
    birth_act.d_julianday1 as ba_year,
    married.d_julianday2 as m_year,
    married.d_julianday2-birth.d_julianday1 as age
    FROM pgv_families AS fam
    LEFT JOIN pgv_dates AS birth ON birth.d_file = 1 and birth.d_fact =
    'BIRT'
    LEFT JOIN pgv_dates AS birth_act ON birth_act.d_file = 1 and
    birth_act.d_fact IN ('BIRT', 'CHR', 'BAPM', '_BRTM')
    LEFT JOIN pgv_dates AS married ON married.d_file = 1 and married.d_fact
    =
    'MARR'
    LEFT JOIN pgv_individuals AS indi ON indi.i_file = 1
    WHERE ((birth.d_gid = indi.i_id) and (birth_act.d_gid = indi.i_id) and
    (birth.d_gid=birth_act.d_gid) ) AND
    married.d_gid = fam.f_id AND
    indi.i_id = fam.{$sex_field} AND
    fam.f_file = 1 AND
    ((birth.d_julianday1 <> 0) OR (birth_act.d_julianday1 <> 0)) AND
    ((married.d_julianday2 > birth.d_julianday1) OR (married.d_julianday2 >
    birth_act.d_julianday1))
    AND
    birth.d_julianday1 <= birth_act.d_julianday1 AND
    i_sex='{$sex}'
    ORDER BY married.d_julianday2-birth.d_julianday1 {$age_dir}"

     
  • fa0850-fa0850
    fa0850-fa0850
    2010-03-08

    This like good for me and your remarks is true i forgot this case.