Jump to content
Server Maintenance This Week. ×

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


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

Recommended Posts

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 . . ."  

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 2296 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.