Page 1 of 1

Calculate individual conceived date

Posted: 13 Mar 2023 00:54
by Darryl-W
Hello,
I want to write query ( I think) that would calculate the date of conceived for individuals in a defined group . I am unable to determine a structure and appeal to the group for help .
Darryl Wise

Re: Calculate individual conceived date

Posted: 13 Mar 2023 02:41
by Ron Melby
fhCallBuiltInFunction('CalcDate' ...)
Function Name:CalcDateDescription:Calculates one date from another date. Takes the first data as a parameter,together with (optionally) a number of years, months and/or days. Thesecan be positive or negative. For example, to find a date that is 10months earlier than a given date, supply 0 years, -10 months, and 0days as parameters.
This function takes leap years into account, and is to that extentaffected by the changeover date for the Gregoriancalendar as specified in Preferences;but it does not allow for the 10 or 11 days that were deducted from the calendar, owing to the changeover date for the Gregorian calendar,when adding or subtracting months and days.

fh help under date and age functions

Re: Calculate individual conceived date

Posted: 13 Mar 2023 02:54
by Ron Melby
note there is going to be some tradeoffs with this.

if you have a date only 1886 or c. 1886 the defaults may not be your best. or if you have btw. jan 1888 and 12 nov 1889. but it is a start.

Ol' mum and da did after all, (start, that is)

Re: Calculate individual conceived date

Posted: 13 Mar 2023 08:35
by tatewise
Ron has possibly confused things a little by giving the Plugin script fhCallBuiltInFunction('CalcDate' ...)

In a Query column you just use the =CalcDate(...) function.
e.g.
=CalcDate(%INDI.BIRT.DATE%, 0, -10)
which is the example given in the function's Help page https://www.family-historian.co.uk/help ... cdate.html

That example assumes you are using an Individual type of Query.

Re: Calculate individual conceived date

Posted: 13 Mar 2023 19:19
by Ron Melby
no, it is not possible, it is certain, Mike.

I was working on a plugin at the time I wrote it, and of course used the plugin form without thought.

Mike has given you the correct and useful form. And I have given you a few of the gotchas.