dadd()

Function group Execute on client Platform(s)
Date and Time YES All

Syntax

dadd(datepart,number,date)

Description

Adds a number of date parts to date.

The datepart argument can be a number of days, months, or quarters depending on the constant you use. The number is interpreted as the number of date or time parts or units specified by a datepart constant. The number argument must be an integer when specifying datepart as kYear, kMonth, kWeek, kQuarter, or kCentiSecond (the fractional part of a number is ignored). You can use fractions for the other date parts.

The datepart constants that you can use are: kYear, kMonth, kWeek, kQuarter, kDay, kHour, kMinute, kSecond, kCentiSecond.

Example

Calculate lDate as dadd(kDay,3,#D)
; returns May 11, 2003, that is, 3 days are added, assume #D is May 8, 2003


Calculate lDate as dadd(kWeek,1.2,#D)
; returns May 16, 2003, that is, 1 week is added, the fraction is ignored, assume #D is May 8, 2003