In a formula type column, the WEEK_DELTA() function calculates the difference, in weeks, between two date-type columns.
-
Function name:
WEEK_DELTA()
Syntax
WEEK_DELTA(date_1, date_2)
Calling function parameters in TimeTonic:
- $field_name = field (link, linked table column, number, selection, formula, text...).
- "free text" = free text to add within quotation marks.
- do not use quotation marks for numbers.
Parameters
| Parameter | Description |
|---|---|
date_1 |
The more recent date (the result corresponds to date_1 minus date_2). |
date_2 |
The reference date to subtract. |
Example
WEEK_DELTA($End, $Start)
The column returns the number of weeks difference between the two dates.
There are 6 weeks difference between April 1, 2022, and May 11, 2022.
There are 10 weeks difference between April 5, 2022, and June 16, 2022.
There are 19 weeks difference between February 8, 2022, and June 23, 2022.
The week count runs from Sunday to Monday.
Return type
The function returns a number (the difference expressed in weeks).
The output format type of the result can be configured in the output field options of the formula editor. For more details, see Output format options in the Formula Column article.
Business use case
WEEK_DELTA() measures a duration in weeks between two milestones: between order and delivery, between opening and closing a file.
Best practice
For a difference relative to today, use WEEK_DELTA_TODAY() instead.