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.

Add one month to the date

Featured Replies

Hi, I want to take a date recorded in a filed and add one month onto it. I have found one way that works by using the calculation:

Day ( DD Start Date ) & "/" & Month ( DD Start Date ) + 1 & "/" & Year ( DD Start Date )

"DD Start Date" is the original field. This actually works which surprised me, but it fails when the next month is January i.e. the year has to increase by one. I assume there is an easier way to do this?

  • Author

Ok actually found the answer, the code is:

Date(Month(DD Start Date)+1; Day(DD Start Date); Year(DD Start Date))

  • 7 months later...

You may need to use commas instead of semicolons, perhaps depending on FMPro version or your country.

Edited by Guest

I thought, particularly now in vs. 9, that we ALL use semi-colons instead of some (like those from the US) needing to use comma. Do you mean that some countries still use commas?

  • 11 months later...

Okay, what happens if the current month is December (i.e., 12). Is the calculation engine smart enough to roll-over to January (1) and increase the year by one? If so, how does one accomplish this, because it's not working for me. For Example, I'm using a Case statement to add to either the month, day, or year depending on what the user chooses from a pop-up. I have the following calculation for the field, but it doesn't seem to be working:


Let ( d = Max ( Companies_Plants_Units_Devices_EVENTS::Date ) ;

    Case (

        TestIntTimeID = 1 ; Date ( Month ( d ) ; Day ( d + TestInt ) ; Year ( d ) ) ;

        TestIntTimeID = 2 ; Date ( Month ( d ) ; Day ( d + ( TestInt * 7 ) ) ; Year ( d ) ) ;

        TestIntTimeID = 3 ; Date ( Month ( d + TestInt ) ; Day ( d ) ; Year ( d ) ) ;

        TestIntTimeID = 4 ; Date ( Month ( d ) ; Day ( d ) ; Year ( d + TestInt ) ) ;

    )

)





Where d is set to a specific date, TestIntTimeID is the ID from the pop-up menu (pertaining to a specific time interval), and TestInt is the amount of time to be added.  In this situation, the following time intervals are available:





+----+--------------+

| ID | TimeInterval |

+----+--------------+

|  1 | Days         |

|  2 | Weeks        |

|  3 | Months       |

|  4 | Years        |

+----+--------------+

Thanks!

Nevermind. I see what I did wrong. I need to add the TestInt outside of the Day() or Month() or Year() function.

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.