Skip to main content

EDATE

Use the EDATE function to modify dates by a specified number of months.

Use

EDATE( start_date, months )
Returns the date adjusted by the number of months before or after the start date.

ParameterRequiredDescription
start_dateYesa date that represents the start date
monthsYesthe number of months before (negative) or after (positive) the start_date

ReturnsDate

Examples

Variable Update (Calculating a Contract Renewal)

You can use EDATE in a Variable Update Formula to automatically calculate a future deadline or expiration date based on information provided during the trigger step.

  • Scenario: An employee submits a "Contract Start Date" on a trigger form. The system needs to calculate a "Review Date" that occurs exactly 6 months after the start date.
  • Formula: EDATE(@Trigger.out.StartDate, 6)
  • Logic:
    • @Trigger.out.StartDate: Pulls the initial date from the trigger step.
    • 6: Specifies that the function should return a date 6 months in the future.
    • Result: If the start date is 01/01/2024, the variable will be updated to 01/07/2024.

Validation Logic (Restricting Backdated Entries)

In an Output Validation Formula, you can use EDATE to ensure that a date entered by a user falls within a specific acceptable window relative to the current date.

  • Scenario: A company policy states that expense claims must be submitted for an invoice date that is no more than 3 months old.
  • Formula: ASSERT(this >= EDATE(TODAY(), -3), "The invoice date cannot be more than 3 months old.")
  • Logic:
    • this: Refers to the date value the user is currently entering.
    • TODAY(): Retrieves the current system date.
    • -3: Tells the EDATE function to look 3 months into the past.
    • ASSERT: If the date entered is earlier than 3 months ago, the function returns FALSE, and GoApprove displays the specified error message.