FH 6.2 used
I am trying to extract individuals based on their military service. My query works for single dates but not for date ranges.
The attached Results does show one record with a date range, but this is a "False positive" as Harry Beeby also has single date for Military ID.
I have also changed a previously found record that had a single date to a date range, but this now fails.
The selection criteria used is attached (Select), as well as one of the records I expected to find...
I do hope that I am doing something wrong and that it is possible to select date ranges.
Best regards
Allan Beeby
* Query over a date range.
-
rallanb
- Newbie
- Posts: 4
- Joined: 06 Sep 2015 17:17
- Family Historian: V6
- Location: Northampton, England
Query over a date range.
- Attachments
-
- FH Query date range Select.JPG (66.36 KiB) Viewed 3383 times
-
- FH Query date range Individual.JPG (120.63 KiB) Viewed 3383 times
-
- FH Query date range Result.JPG (163.71 KiB) Viewed 3383 times
- Jane
- Site Admin
- Posts: 8442
- Joined: 01 Nov 2002 15:00
- Family Historian: V7
- Location: Somerset, England
- Contact:
Re: Query over a date range.
Try removing the YEAR qualifier or using XDATE1
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
- tatewise
- Megastar
- Posts: 27088
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Query over a date range.
May I comment on your use of Date Range in this context.
As the Date Entry Assistant in your posting says: "... Do not confuse this with specifying a period (see Period tab)."
In your example it is saying J W Beeby was in Military Service on some specific Date between 1914 and 1919.
Whereas what I think you mean is J W Beeby was in Military Service all the time from 1914 to 1919.
The general advice is that Events use a Date Range for a non-specific day, because Events usually only happen on one day, such as Birth, Marriage, Census, Death.
Whereas Attributes use a Date Period for the duration that they apply, such as Residence, Occupation, Military Service.
In fact that advice is prescribed in the Gedcom specification.
BTW: If you really need to obtain the Year from any Date the following advice applies.
The %...DATE:YEAR% qualifier only works for a simple date and NOT Date Period or Date Range.
Use the =Year(%...DATE%) function which gives the year of a simple date or the first date of a Date Period or Date Range.
As the Date Entry Assistant in your posting says: "... Do not confuse this with specifying a period (see Period tab)."
In your example it is saying J W Beeby was in Military Service on some specific Date between 1914 and 1919.
Whereas what I think you mean is J W Beeby was in Military Service all the time from 1914 to 1919.
The general advice is that Events use a Date Range for a non-specific day, because Events usually only happen on one day, such as Birth, Marriage, Census, Death.
Whereas Attributes use a Date Period for the duration that they apply, such as Residence, Occupation, Military Service.
In fact that advice is prescribed in the Gedcom specification.
BTW: If you really need to obtain the Year from any Date the following advice applies.
The %...DATE:YEAR% qualifier only works for a simple date and NOT Date Period or Date Range.
Use the =Year(%...DATE%) function which gives the year of a simple date or the first date of a Date Period or Date Range.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
-
rallanb
- Newbie
- Posts: 4
- Joined: 06 Sep 2015 17:17
- Family Historian: V6
- Location: Northampton, England
Re: Query over a date range.
Many thanks
The difference between the two date periods is obvious, once it has been explained. Thanks again for that.
Also I should have seen that a date range is catered for. (DATE1 and DATE2)
The code as below gives me exactly what I was after. Once again
Many thanks
The difference between the two date periods is obvious, once it has been explained. Thanks again for that.
Also I should have seen that a date range is catered for. (DATE1 and DATE2)
The code as below gives me exactly what I was after. Once again
Many thanks