Page 1 of 1

Query - look for text in Note

Posted: 10 Aug 2023 11:04
by quarlton
As usual I think I am asking for the impossible or something near it.

I'm trying to write a query that looks at %INDI.NOTE2[1]%

There will always be a line in that note somewhere in it that looks like:-
CENSUSES: (c1847-1924) (where the values in brackets are there person's life dates)

Don't ask why - not my data 😀

Ideally I would like to return just that line.

Alternatively it would suffice if I could test to see if the note contains the TextPart of Life Dates

I thought this might work but it doesn't

Code: Select all

Add if 
%INDI.NOTE2[1]%
Contains
=TextPart(LifeDates(%INDI%,STD),-1,1,STD)

Re: Query - look for text in Note

Posted: 10 Aug 2023 11:12
by tatewise
That is perfectly feasible by using the =GetLabelledText(...) function.

In the Columns tab, you need the Expression: =GetLabelledText( %INDI.NOTE2%, "CENSUSES:" )
That will display whatever follows the CENSUSES: label on the same line or nothing.

In the Rows tab, add the following filter:
Condition: Add unless...
Expression: =GetLabelledText( %INDI.NOTE2%, "CENSUSES:" )
Operator: is null

Re: Query - look for text in Note

Posted: 10 Aug 2023 11:21
by quarlton
As usual Many Thanks Mike.

I haven't come across =GetLabelledText() before, or if I had I didn't appreciate what it did.