Calculation to Add days to todays date

Viewing 2 reply threads
  • Author
    Posts
  • January 16, 2018 at 5:50 PM #27014

    Lynn W
    Participant

    I have the following Fields on a form {Date}, {Storage}, and {Expiry Date}.

    I want the {Expire Date} to be calculated by adding the number entered into the {Storage} field to the {Date} field.
    Example {Expiry Date} = ({Date} + {Storage}) I am having trouble with the syntax of the formula.

    The {Storage} field is a number field that is different for each record ie. 10, 14, 20,
    Any help will be appreciated.

    Thanks
    Lynn

    January 16, 2018 at 9:58 PM #27017

    Brendan
    Keymaster

    Hi Lynn,

    Your Expiry Date field must be a Calculation field for this to work that returns a Date value.

    Now just use the DATEADD(Date;Y;M;W;D;H;M;S) function like this:

    DATEADD([Date];0;0;0;[Storage];0;0;0)

    Set the Return Type to Date.

    That’ll return a Date that has [Storage] days added to it. But you didn’t state the units for your Storage field, so I just assumed days.

    If you notice, [Storage] is inserted into the same spot where D would be in the above set of parameters for the DATEADD() function. If Storage represents a different unit, just put it in the appropriate place in the parameters.

    This only works with the most recent versions of Tap Forms. So update if you haven’t so you can get the DATEADD() function.

    Hope that helps!

    Brendan

    January 16, 2018 at 10:00 PM #27019

    Brendan
    Keymaster

    By the way, the parameters of DATEADD(Date;Y;M;W;D;H;M;S) are:

    Date field; Year; Month; Week; Day; Hours; Minutes; Seconds

    in case it wasn’t obvious

Viewing 2 reply threads

You must be logged in to reply to this topic.