* Custom Queries with an And

Homeless Posts from the old forum system
Locked
avatar
pbryan
Gold
Posts: 18
Joined: 04 Dec 2004 18:37
Family Historian: None

Custom Queries with an And

Post by pbryan » 07 Mar 2007 18:15

I want to write a custom query that searches for all of the people in the file who have a surname of Smith and I have found on the 1851 Census.

I have created a flag for the 1851 Census and attached it to all of the people, both Smith and non-Smith, who I have found.

The problem is the the Flag attribute can be excluded if it is set, but not if it is not set in the query.

Anyone able to help on this one?

Paul

ID:2226

avatar
JonAxtell
Superstar
Posts: 481
Joined: 28 Nov 2006 09:59
Family Historian: None

Custom Queries with an And

Post by JonAxtell » 08 Mar 2007 08:23

I think (if I understand your question) what you need is an 'exclude unless' condition to include the flag. What the exclude is doing is throwing away all the records in the result set except those that have the flag set.

Add if %INDI.NAME:SURNAME% matches 'smith'
Exclude unless %INDI._FLGS.__1851Census

Alternatively, an 'Exclude if' condition on the flag will only list individuals who don't have the flag set.

Hopefully that helps I could be getting it all wrong. I'm still trying to get my brain round the query system. It makes me think extremely hard at writing the right query with a lot of trail and error when all I want to do is write a query without thinking.

avatar
pbryan
Gold
Posts: 18
Joined: 04 Dec 2004 18:37
Family Historian: None

Custom Queries with an And

Post by pbryan » 08 Mar 2007 18:20

Thanks John, that is exactly what I needed.

I think the the query system s really powerful. The problem is that it seems to be written for someone who does not program computers for a living.

If you do, then the lack of boolean operators AND,OR,NOT and XOR is somewhat confusing.

Paul

Locked