Jump to content
Sign in to follow this  
Raymond Gonzalez

Calculated End Date

Recommended Posts

Hello. I have 3 fields. "Start Date", "End Date" and "Plan".

The "Plan" has 3 options "1 month", "3 months" and "1 year".

I want that if the "Plan" is "1 month" that the "End Date" be the "Start Date" plus 1 month, and the same with the other options. How can i do it? Thanks

Share this post


Link to post
Share on other sites

Change the field "End Date" to a calculation field, using the following calculation:

Start Date + Case( Plan = "1 month"; 30; Plan = 3 months"; 90; Plan = "1 year"; 365)

Then change the storage options so that it "Recalculates when needed." And set the result type to Date.

Also, make sure your Start Date field is a Date field.

Edited by Guest

Share this post


Link to post
Share on other sites

If you want to be a bit more precise:

Let( months = Case( Plan = "1 year" ; 12; GetAsNumber( Plan ) ) ; 

    Date( Month(Start Date) + months ; Day(Start Date) ; Year(Start Date) )

    )

Also, End Date could be a calculated field, but an auto-enter field could work as well.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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