In a formula-type column, the DATE_ADDNB() function displays a date obtained by adding, to a date-type column, the number of days contained in an integer number-type column. The initial date is counted as a full day.
-
Function name:
DATE_ADDNB()
Syntax
DATE_ADDNB(date_column, number_column)
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_column |
The date-type column serving as the starting point. |
number_column |
The integer number-type column indicating the number of days to add. Positive to move the date forward, negative to move it backward. |
Example
To calculate a reminder date from a last meeting date and a delay stored in a column:
DATE_ADDNB($Last meeting, $Reminder)
Depending on the value of the Reminder column, TimeTonic adds this number of days to the last meeting date to return the reminder date.
Notes
- The initial date is counted as a full day:
DATE_ADDNB(10/10, 3)returns12/10(10/10 counts as the first day). - The result is therefore shifted by one day compared to
DATE_ADD(), which does not include the starting date in the count. - The number of days can be negative.
Return type
The function returns a date.
The output type format 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
DATE_ADDNB() calculates deadlines where the delay varies from one record to another: reminder date according to a client-specific frequency, next visit according to a contractual delay.
Best practice
Choose the function according to the expected counting: DATE_ADD() for a strict offset (excluding the start date), DATE_ADDNB() when the initial date should count as the first day.