Page 1 of 1
Query
Posted: 21 Nov 2010 13:31
by mikegscoles
I am trying to write a query to find which of my people I have found a marriage certificate for.
I have created separate sources for each individual certificate and a type for the source - 'Marriage Certificate'.
The filter %INDI.SOUR[1]>_TYPE% Matches 'Marriage Certificate'does not produce any results.
Can anyone help?
Mike
ID:4871
Query
Posted: 21 Nov 2010 14:47
by delwoodman
Mike:
A query I have used successfully for this situation uses the filter:
%INDI.FAMS>MARR.SOUR>_TYPE% Matches 'marriage certificate'
Hope this helps.
Derek
Query
Posted: 21 Nov 2010 15:22
by mikegscoles
Thanks for your reply Derek.
I stll cannot get it to work.
What do you use for the column expression - I assume it is a family query?
Mike
Query
Posted: 21 Nov 2010 15:53
by delwoodman
The filter I posted was for an individual query. For a family query (which is probably better) use theexpression
%FAM>MARR.SOUR>_TYPE%
I've road-tested both this and the individual version and they work with my dataset.
Depending how you have named your individual certificate sources (for example mine are all in the form 'Marriage certificate of X and Y') you could use the filter
Add if %FAM.MARR.SOUR>TITL% contains 'marriage certificate'
taking care to see that the match case box is unticked.
Regards,
Derek
Query
Posted: 21 Nov 2010 16:47
by Jane
mikegscoles said:
The filter %INDI.SOUR>_TYPE% Matches 'Marriage Certificate'does not produce any results.
The reason this does not work is you are looking for the source type for the individual record being the Marriage Certificate rather than as Derek correctly suggests the source for the Marriage event of the Family as Spouse.
Derek: for the Family Query I would have expected:
%FAM.MARR[1].SOUR[1]>_TYPE%
As you don't need to change records between the FAM and the MARR
Query
Posted: 21 Nov 2010 16:55
by mikegscoles
Thanks again.
The query works but what I wanted to do was to use the output to add a flag to the individuals in diagrams.
Unfortunately it appears that flags cannot be added using 'Set flag on result set records' using the queries you suggest.
Mike
Query
Posted: 21 Nov 2010 22:55
by PeterR
A Flag can only be set for Individual records, not for Family records. Thus an
Individual Query with the following row filter can be used (as first suggested by Derek above), and then you can use the menu option to
Set Flag on Result Set Records...:
Code: Select all
Add if %INDI.FAMS[1]>MARR[1].SOUR[1]>_TYPE% matches 'Marriage Certificate'
You only need the default column expression
%INDI%. However, please note that this only detects Individuals where there is a marriage certificate for their
1st marriage, i.e. the marriage to their 1st spouse. You can Add an additional filter for the
2nd marriage, i.e. strictly the 1st marriage to their 2nd spouse:
Code: Select all
Add if %INDI.FAMS[2]>MARR[1].SOUR[1]>_TYPE% matches 'Marriage Certificate'
However, please also note that both these filters only detect marriages where the
1st Source is the marriage certificate. You may also need
additional filters like the following for cases where there is more than one Source:
Code: Select all
Add if %INDI.FAMS[1]>MARR[1].SOUR[2]>_TYPE% matches 'Marriage Certificate'
Add if %INDI.FAMS[2]>MARR[1].SOUR[2]>_TYPE% matches 'Marriage Certificate'
If you use a
Family query with row filters as follows you can then use the menu option to
Add Result Set Records to Named List...:
Code: Select all
Add if %FAM.MARR[1].SOUR[1]>_TYPE% matches 'Marriage Certificate'
Add if %FAM.MARR[1].SOUR[2]>_TYPE% matches 'Marriage Certificate'
Query
Posted: 22 Nov 2010 10:23
by delwoodman
Apologies to Mike if I misled him by the typo in my earlier post - Jane is of course correct and the line I intended to type was
%INDI.FAMS.MARR.SOUR>_TYPE% Matches 'marriage certificate'
As Peter says, however, further tweaks are necessary to allow for second marriages or for multiple sources.
Derek
Query
Posted: 22 Nov 2010 10:37
by mikegscoles
Many thanks to Derek, Jane and Peter,
All is now clear and all is now working.
Mike