* Query to find all dates with year modifier

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile. If your question fits in one of these subject-specific sub-forums, please ask it there.
Post Reply
User avatar
LornaCraig
Megastar
Posts: 2996
Joined: 11 Jan 2005 17:36
Family Historian: V7
Location: Oxfordshire, UK

Query to find all dates with year modifier

Post by LornaCraig » 19 Jan 2013 15:35

I am trying to construct a query to find all date fields which contain a year modifier: that is, all dates which have been entered with the year in the format 1715/16, indicating 'double dating'.

I want to do this because I think when I first started using FH several years ago I may have wrongly entered some dates as double dates which were post 1752 or which didn't fall between 1 January and 24 March, so double dating didn't apply.

I'm not having any success - can anyone help?

ID:6709

User avatar
Jane
Site Admin
Posts: 8442
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Query to find all dates with year modifier

Post by Jane » 19 Jan 2013 16:40

I can't think of a way as containstext does not spot the '/' in the date field.

You could very easily write a plug in for this. Have you tried plugin writing yet?

avatar
delwoodman
Famous
Posts: 125
Joined: 15 Sep 2007 10:42
Family Historian: V6.2
Location: Brighton, East Sussex, UK

Query to find all dates with year modifier

Post by delwoodman » 19 Jan 2013 16:56

Lorna:
A fact query with the following filter works for me (version 5.0.7)Image

Derek

User avatar
Jane
Site Admin
Posts: 8442
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Query to find all dates with year modifier

Post by Jane » 19 Jan 2013 17:02

Well done Derek, I assumed dates did not have contains text.


Anyway I had written the Plugin so I'll put the link here, but I won't bother posting it to the store.

https://www.dropbox.com/s/bik9yf5st9l5z ... tes.fh_lua

User avatar
LornaCraig
Megastar
Posts: 2996
Joined: 11 Jan 2005 17:36
Family Historian: V7
Location: Oxfordshire, UK

Query to find all dates with year modifier

Post by LornaCraig » 19 Jan 2013 17:40

Many thanks to both Derek and Jane.  I had been trying to use an individual query rather than a fact query.

I have run both the query and the plugin and was initially puzzled by a slight discrepancy in the results.  This turned out to be because the plugin picks up double dates in the 'Entry Date' field of the Source pane, in addition to fact dates.  I don't know whether it would be possible for a query to pick that up - if not, it might still be worth posting your plugin to the store, Jane.

Thanks again to both.

User avatar
PeterR
Megastar
Posts: 1129
Joined: 10 Jul 2006 16:55
Family Historian: V7
Location: Northumberland, UK

Query to find all dates with year modifier

Post by PeterR » 19 Jan 2013 18:01

You could have a Fact query with an additional Row Filter to the one above, using the following expression:

Code: Select all

%FACT.SOUR[1].DATA.DATE%
You would also have to add a corresponding additional column.

The problem is that you would also have to repeat additional row filters and columns to cope with Facts having more than one Source, e.g.:

Code: Select all

%FACT.SOUR[2].DATA.DATE%
Thus Jane's Plugin is certainly preferable.

User avatar
tatewise
Megastar
Posts: 27088
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Query to find all dates with year modifier

Post by tatewise » 19 Jan 2013 18:15

Yes, this problem is really annoying.
FH should have a wild card index that allows all instances in a Row Filter to be included.
Similar to the Text Scheme looping index [1+] feature.

User avatar
LornaCraig
Megastar
Posts: 2996
Joined: 11 Jan 2005 17:36
Family Historian: V7
Location: Oxfordshire, UK

Query to find all dates with year modifier

Post by LornaCraig » 19 Jan 2013 19:15

One further thought: I have a few Multimedia objects with double dates (images of parish records).  I have identified these easily because they are linked via Source records to  individuals who have double-dated facts.  

Could the plugin be amended to pick these up too?  I don't actually need this refinement because I have already identified them, but it might increase the potential value of the plugin.

User avatar
Jane
Site Admin
Posts: 8442
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Query to find all dates with year modifier

Post by Jane » 19 Jan 2013 21:40

Media can be done easily, if you fancy changing the allitems loop code (lines 20 and 21) to

Code: Select all

for ptr in allItems('INDI','FAM','OBJE') do
        if fhGetValueType(ptr) == 'date' then

That will do it or just download the plugin again.

User avatar
LornaCraig
Megastar
Posts: 2996
Joined: 11 Jan 2005 17:36
Family Historian: V7
Location: Oxfordshire, UK

Query to find all dates with year modifier

Post by LornaCraig » 19 Jan 2013 21:45

Thanks Jane, I thought I had found them all but that flushed out a couple more!

User avatar
Jane
Site Admin
Posts: 8442
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Query to find all dates with year modifier

Post by Jane » 22 Jan 2013 16:47

I have done an extended version of this one called

Date Search and Return Result set which searches for

Qualified Dates
or
Double Dates
or
Dates which match or overlap a selected date.

If anyone has time to take a look it can be downloaded from

https://www.dropbox.com/s/luqrfh375xymf ... Set.fh_lua

User avatar
LornaCraig
Megastar
Posts: 2996
Joined: 11 Jan 2005 17:36
Family Historian: V7
Location: Oxfordshire, UK

Query to find all dates with year modifier

Post by LornaCraig » 22 Jan 2013 21:49

Thanks Jane, this extended version of the plugin meets a need I didn't know I had.  It has shown up a few inconsistencies in the use of the 'estimated' and 'approximate' qualifiers and prompted me to change a few 'est' entries to 'app'.

I can see that it could also be useful for searching for any events on a particular date or in a date range. I wonder if a refinement might help here.  For example at present if you search for 1800, or the range 1800 to 1805, the result set includes dates like 'before 1945' because that overlaps the date/range searched for.  I might be useful to have another option to return only dates which match or fall within the date/range searched for.

User avatar
Jane
Site Admin
Posts: 8442
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Query to find all dates with year modifier

Post by Jane » 22 Jan 2013 23:38

I wondered about the Before and After dates. They are always a problem especially if viewed, as the plugin does, in isolation. I'll have another think about them.

Post Reply