Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Date Calculation

Featured Replies

FM accepts the following calculation but it's not doing what I require it to. I'm trying to conditionally format a date field if the current date minus 3 years is >= TOP 006 Records 3::Most Recent Date.

 

What's glaringly wrong, the first part of my calculation between Day, Month etc won't accept ; hence &, but the second part does?

 

Day (Get (CurrentDate)) & Month (Get (CurrentDate)) & Date(Year( Get (CurrentDate) - 3) >= Day ( TOP 006 Records 3::Most Recent Date ); Month (TOP 006 Records 3::Most Recent Date );Year (TOP 006 Records 3::Most Recent Date ))

 

 

 

Try =

Date ( Month ( Get(CurrentDate) ) ; Day ( Get (CurrentDate) ) ; Year( Get(CurrentDate) ) - 3 ) ≥ TOP 006 Records 3::Most Recent Date

or =

Let (
today = Get (CurrentDate)
;
Date ( Month ( today ) ; Day ( today ) ; Year ( today ) - 3 ) ≥ TOP 006 Records 3::Most Recent Date
)
  • Author

Thanks comment. So I erroneously thought TOP 006 Records 3::Most Recent Date needed breaking down into Day, Month and Year.

 

Also TOP 006 Records 3::Most Recent Date is formatted dd/mm/yyyy. Do I have to reverse the Month and Day in your calculation?

So I erroneously thought TOP 006 Records 3::Most Recent Date needed breaking down into Day, Month and Year.

 

That's right: it's already a date and doesn't need to anything to be done to it. Get (CurrentDate) is also a date - but in order to subtract 3 years from it, you need to:

1. Break it up to individual elements;

2. Subtract 3 from the Year element;

3. Recombine the elements into a date.

It was step #3 that was the major issue in your attempt; you tried to concatenate them as text, instead of plugging them into the Date() function which was written specifically for this purpose.

 

 

Do I have to reverse the Month and Day in your calculation?

No. The order of parameters of the Date() function is universal.

  • Author

That's right: it's already a date and doesn't need to anything to be done to it. Get (CurrentDate) is also a date - but in order to subtract 3 years from it, you need to:

1. Break it up to individual elements;

2. Subtract 3 from the Year element;

3. Recombine the elements into a date.

It was step #3 that was the major issue in your attempt; you tried to concatenate them as text, instead of plugging them into the Date() function which was written specifically for this purpose.

 

 

No. The order of parameters of the Date() function is universal.

 

Thank you very much for your explanation.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.