Data Transformation Engine Functions and Expressions Reference Guide

Chapter 3 - Function Reference ADDDAYS
Functions and Expressions Reference Guide
60
ADDDAYS
The ADDDAYS function adds a specified number of days to a given date.
Syntax
ADDDAYS (single-date-expression, single-integer-expression)
Meaning
ADDDAYS (any_date, number_of_days_to_add)
Returns
This function returns a single-date.
Returns the date that results from adding number_of_days_to_add to
any_date. If any_date has a presentation that does not contain a century, the
century is determined based on the Century > CCLookup map setting (when
the Century > Switch = ON), or the current century (when the
Century > Switch = OFF).
Examples
ADDDAYS (InvoiceDate, 10)
Returns the date that results from adding 10 days to the value of
InvoiceDate.
ADDDAYS (InvoiceDate, DaysTilDue)
Returns the date that results from adding the value of DaysTilDue to the
InvoiceDate.
ADDDAYS (TODATETIME ("000101"), -1)
Returns 991231
ADDDAYS (TODATETIME ("20000101"), 1)
Returns 20000102
ADDDAYS (TODATETIME ("10/20/1996", "{MM/DD/CCYY}"), 5)
Returns 10/25/1996
In the examples containing the
TODATETIME function, the text literal is first
converted to a date, and then the specified number of days is added to that
date.