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

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

Recommended Posts

Posted

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?

  • 7 months later...
Posted (edited)

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

Edited by Guest
Posted

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

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!

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