* Query

Homeless Posts from the old forum system
Locked
avatar
mikegscoles
Diamond
Posts: 66
Joined: 01 Sep 2006 21:27
Family Historian: V6.1

Query

Post by mikegscoles » 21 Nov 2010 13:31

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

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

Query

Post by delwoodman » 21 Nov 2010 14:47

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

avatar
mikegscoles
Diamond
Posts: 66
Joined: 01 Sep 2006 21:27
Family Historian: V6.1

Query

Post by mikegscoles » 21 Nov 2010 15:22

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

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

Query

Post by delwoodman » 21 Nov 2010 15:53

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

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

Query

Post by Jane » 21 Nov 2010 16:47

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

avatar
mikegscoles
Diamond
Posts: 66
Joined: 01 Sep 2006 21:27
Family Historian: V6.1

Query

Post by mikegscoles » 21 Nov 2010 16:55

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

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

Query

Post by PeterR » 21 Nov 2010 22:55

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'

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

Query

Post by delwoodman » 22 Nov 2010 10:23

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

avatar
mikegscoles
Diamond
Posts: 66
Joined: 01 Sep 2006 21:27
Family Historian: V6.1

Query

Post by mikegscoles » 22 Nov 2010 10:37

Many thanks to Derek, Jane and Peter,

All is now clear and all is now working.

Mike

Locked