Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Panel
bgColor#B3D4FF

Average

...

Panel
bgColor#B3D4FF

DateDiff

The ‘DateDiff’ formula is used to evaluate the difference between two

...

Dates (and

...

Times, if available). Parameters include:

  1. The Date (and Time, if available) from which the other date will be subtracted from.

  2. The Date (and Time, if available) which will be subtracted from the first parameter.
    For the above two parameters, the date can be optionally specified as the following strings:
    'now' → Date and time at the moment logic is evaluated
    'today' → Date on which the formula is evaluated
    'yesterday' → Yesterday’s date (no time component)
    'tomorrow' → Tomorrow’s date (no time component)

  3. The format in which the result is required
    The format can be:
    'd' → total days
    'h' → total hours
    'm' → total minutes
    's' → total seconds

...

  • DateDiff('yesterday', ‘now', ‘m')
    This calculates the total minutes between yesterday’s date (parameter 1) and the date and time for right now (parameter 2).
    If the yesterday's date is 07/10/2023 and we are evaluating this function at 07/11/2023 at 4:07pm 07p.m. then the result results (in minutes) should look like: ‘yesterday’ (Parameter 1) minus ‘now’ (Parameter 2) = -2407.5039294216667

...

  • When do I use DateDiff to change stages?

    • You DateDiff can use DateDiff be used when you want to change to the next stage after a certain amount of time has elapsed since a date question has been answered.

...

The “FinalStage” stage is Time Based and will only be active for 1 day (24 hours) since the stage does not end at midnight.

...


datediff('today', [study_startdate],'d')>=3

Current Date

Question Variable

Result

Interpretation

today = 04/17/2024

study_startdate = 04/17/2024

0

False - stays in the current stage

today = 04/17/2024

study_startdate = 04/12/224

5

True - transitions to next stage

...