Page 1 of 1

Calculate Birth date from date & age in other facts

Posted: 18 Sep 2021 16:13
by tatewise
The Email forum had this Calculate Birth date from age at death posting that got me thinking.
There are plenty of online date calculators (some were mentioned in that posting) but FH should be able to do that too.
So I started investigating using a Query and it was far more than complex than I expected.

After creating the Birth Date from Age at Death Query linked to that posting, it occurred to me that calculating a Birth Date from any Fact with a Date and Age was feasible. So I've written the Birth Date Calculator Query attached below.
It is a Fact Query that takes account of most Facts and most Date & Age formats.
The exceptions are the Marriage Age of women can't be included and the Age of Child or Infant is deemed to be 1 year.
It only works in FH v7.0. Please give it a whirl.

The biggest challenge was extracting the year, month & day integers from the Age so they can be supplied as parameters for the =CalcDate(...) function. Also, the Age fields in Individual and Family facts have different data references.
A Plugin would be somewhat simpler as it has functions for extracting the year, month & day integers from the Age field.
Perhaps the existing FH functions =Year(), =Month() & =Day() could be enhanced to accept Age as well as Date fields.