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
* Custom Queries with an And
Custom Queries with an And
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.
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.
Custom Queries with an And
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
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