* Query - look for text in Note

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile. If your question fits in one of these subject-specific sub-forums, please ask it there.
Post Reply
avatar
quarlton
Famous
Posts: 150
Joined: 26 Feb 2004 13:07
Family Historian: V7
Location: Lincolnshire
Contact:

Query - look for text in Note

Post by quarlton » 10 Aug 2023 11:04

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)
Dave Simpson ~ Boulton, Braham, Carney, Simpson and Jacobs

User avatar
tatewise
Megastar
Posts: 27074
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Query - look for text in Note

Post by tatewise » 10 Aug 2023 11:12

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
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
quarlton
Famous
Posts: 150
Joined: 26 Feb 2004 13:07
Family Historian: V7
Location: Lincolnshire
Contact:

Re: Query - look for text in Note

Post by quarlton » 10 Aug 2023 11:21

As usual Many Thanks Mike.

I haven't come across =GetLabelledText() before, or if I had I didn't appreciate what it did.
Dave Simpson ~ Boulton, Braham, Carney, Simpson and Jacobs

Post Reply