* Help with source template expression

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
Peter Collier
Famous
Posts: 191
Joined: 04 Nov 2015 17:32
Family Historian: V7
Location: Worcestershire, UK

Help with source template expression

Post by Peter Collier » 09 Jan 2023 21:32

I have a date field in a source template called "Publication date". I want to be able to separate the day and month from that field to suit a particular footnote style.

{Publication_date:YEAR} separates out the year for me, and I can get half way there with the day and month by using the expression {=Day(%SOUR.~DT-Publication_date%)} {=Month(%SOUR.~DT-Publication_date%)}. However, {=Month... returns the month number, whereas I want the (full) month name.

I know that is the correct behaviour for =Month. How might I change the expression, so that I get the full month name, rather than just the month number?

In full, the footnote format currently reads:
<{Author}.> <({Publication_date:YEAR})> <'{Article_title}'.> <i>{Publication_title}.</i> < {=Day(%SOUR.~DT-Publication_date%)} {=Month(%SOUR.~DT-Publication_date%)}.> <{Page_and_column}.>

The output, as I want it to appear, would be (for example):
Higginbottom, Josiah. (1880) 'Stealng a Loaf'. Derby Daily Telegraph and Reporter. 12 March. p. 3

Currently, I am getting:
Higginbottom, Josiah. (1880) 'Stealng a Loaf'. Derby Daily Telegraph and Reporter. 12 3. p. 3
Peter Collier

Collier, Savory, Buckerfield, Edmonds, Low, Dungey, Lester, Chambers, Walshe, Moylan, Bradley, Connors, Udale, Wilson, Benfield, Downey

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

Re: Help with source template expression

Post by tatewise » 09 Jan 2023 21:47

Instead of using FH Functions, use Date Qualifiers like you are with :YEAR as defined in the Help page Date Formats.
i.e.
{Publication_date:DAY} {Publication_date:MONTH_NAME}
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
Peter Collier
Famous
Posts: 191
Joined: 04 Nov 2015 17:32
Family Historian: V7
Location: Worcestershire, UK

Re: Help with source template expression

Post by Peter Collier » 09 Jan 2023 22:03

Unfortunately, that doesn't work. I get the following error message:
Screenshot.jpg
Screenshot.jpg (17.33 KiB) Viewed 317 times
That is what pushed me down the function route.
Peter Collier

Collier, Savory, Buckerfield, Edmonds, Low, Dungey, Lester, Chambers, Walshe, Moylan, Bradley, Connors, Udale, Wilson, Benfield, Downey

avatar
Peter Collier
Famous
Posts: 191
Joined: 04 Nov 2015 17:32
Family Historian: V7
Location: Worcestershire, UK

Re: Help with source template expression

Post by Peter Collier » 09 Jan 2023 22:07

I should add, the same error message appears, mutatis mutandis, for the title, bibliography, and short footnote. The error doesn't just appear for the footnote format.
Peter Collier

Collier, Savory, Buckerfield, Edmonds, Low, Dungey, Lester, Chambers, Walshe, Moylan, Bradley, Connors, Udale, Wilson, Benfield, Downey

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

Re: Help with source template expression

Post by tatewise » 09 Jan 2023 22:17

Sorry, I'd overlooked that only the :YEAR Qualifier works on Date Field {Name} (for some reason that only CP can explain).
So you must use the Data Reference alternative which does work:
{%SOUR.~DT-Publication_date:DAY%} {%SOUR.~DT-Publication_date:MONTH_NAME%}
which makes explaining why {Publication_date:DAY} {Publication_date:MONTH_NAME} don't work even stranger.
Perhaps you'd like to ask CP :D
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

Post Reply