Page 1 of 1

Data Reference for YEAR

Posted: 08 Mar 2023 20:04
by brianlummis
I am using a Query where I am trying to list individuals that have a death date before a given year. In the Rows tab I am using the following expression .
"Exclude if %INDI.DEAT.DATE:YEAR% is less than ....."
However when I run the query many of the individual are not excluded even though the year of death is prior to the date I am testing. The reason appears to be that I have used the specifier "Before" in the Death Date, and the year is ignored when the query is run.

Have I missed something or is this as intended?

Brian

Re: Data Reference for YEAR

Posted: 08 Mar 2023 20:35
by LornaCraig
You said you want to list individuals who have a death date before a given year. Is that what you meant?

Your filter Exclude if %INDI.DEAT.DATE:YEAR% is less than ..... will exclude those people, not include them.

You would need to Add if %INDI.DEAT.DATE:YEAR% is less than... or Exclude unless %INDI.DEAT.DATE:YEAR% is less than ...

However, I can see that the use of 'before ' in the death date complicates things. I'm not sure how to get round that, but no doubt Mike will be along soon with a solution!

Re: Data Reference for YEAR

Posted: 08 Mar 2023 21:03
by brianlummis
Sorry Lorna, I wasn't very clear even though I read through my requirements several times. :oops:

What I need is a list of individuals that exclude those who have died before a certain date. I have started my query by adding a list of those born after a certain date leaving me with a list of individuals between those two dates.

I will wait for Mike :)

Edit: I didn't have to wait long!

Re: Data Reference for YEAR

Posted: 08 Mar 2023 21:05
by tatewise
Instead of the :YEAR qualifier that only works on simple Dates, use the =Year(...) function that works for Date Periods and Ranges too. If there are two Dates in the Period or Range then I think it produces the first one.
i.e. =Year(%INDI.DEAT.DATE%)

Re: Data Reference for YEAR

Posted: 08 Mar 2023 21:16
by brianlummis
Thanks Mike

I have tried your suggestion and it gives me the result I was looking for. I did try to read through the FH Help and the FHUG Knowledgebase but I missed that function.

Brian