Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

Insert last year's date (just the year) in a sentence


This topic is 2575 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Every January, I send out a note referring to the previous year.  Is there a way to have the previous year inserted automatically in the sentence?

 

ex. "Total number of hours served in 2017 . . ."  

 

Posted

Why not create a field for the year, it could be just a number or use the year function.

 Year (yourDate::Date ) and then merge either of those Fields.

Posted

Thanks for the quick reply.  Sorry, I'm not quite getting what I should do.  I'm able to insert just the current year into my sentence using {{CurrentDate}} , formatting out the month and day.

So my sentence now says . . . Total number of hours served in 2018:

I need the sentence to say . . . Total number of hours served in 2017:

Is there some way to impose a calculation on the {{CurrentDate}} ?   Something like {{CurrentDate}} - 1

Posted

Date ( Month ( Get( CurrentDate )  ) ; Day ( Get(CurrentDate ) ) ; Year (Get(currentdate ) ) - 1 )

Posted

I'm so sorry.  I'm obviously missing something.  Maybe I need to explain myself better.

In my annual letter that I send out each January (it's in Layouts), there's a phrase in one of my sentences that says (this is in the Layout Mode), "Total number of hours served in {{CurrentDate}}:

When I go into the Browse mode, that phrase becomes, "Total number of hours served in 2018:"  I need to have a phrase that says, "Total number of hours served in 2017:"  So in the Layout Mode, what does that sentence need to look like?  When I tried the formula you typed above, it wasn't generating anything when I went back into the Browse Mode.  Also, you have listed Month and Day . . . I only need the year.

Thanks.

Posted

Hi sdutton,

I understand what you are asking, and I think this is more of how to implement it.

Why not post a copy of your file or a mock up of it, so we can see your schema?

Lee

 

Posted

Is your text in a text object? I.e., it's not in a field, it's directly on the layout? You can't perform calculations directly in text objects.

In order to use the calculation you want -- Year(Get (CurrentDate))-1 -- you'll need to create a calculated field (or a field where you set the calculation using auto-entry or a script, or use a script to set a global variable). Make sure the storage of the calculated field is set to unstored so it will always update.

You can then use Insert > Merge Field (or Merge Variable) to insert the field or variable into your text.

This topic is 2575 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.