Calculate the length of a marriage (How To)


The function below will calculate in years the length of a marriage. To compute the end of the marriage is uses the follow dates in order

  1. Divorce Date if it exists
  2. Husband’s Death Date, if it exists and is earlier than the Wife’s Death
  3. Wife’s Death Date

If there is no marriage date or none of the above exists the function will return a Null (the value of the Wife’s death date)


Join back into one line to use.

or not(exists(%FAM.WIFE>DEAT.DATE%)),

Returns the type of Date e.g. Before After from the second date used. The XDATETYPE will return the type of the date. If you wanted to you could combine the two into a single column on your Query or you might want to show the XDATETYPE for the marriage date as well.

or Not(Exists(%FAM.WIFE>DEAT.DATE%)),

Last update: 22 Feb 2024