@DATEROLL

To the given date, rolls (adds or subtracts) a number of specific time intervals, returning another date. This function assumes a standard Gregorian calendar.

Syntax

@DATEROLL ( date, date_part, number )
ParameterDescription

date

A number representing the date between January 1, 1970 and Dec 31, 2037. The number is the number of seconds elapsed since midnight, January 1, 1970. To retrieve this number, use either of the following functions: @TODAY, @TODATEEX.

Date-time attribute properties of a member can also be used to retrieve this number. For example, @AttributeVal("Intro Date"); returns the product introduction date for the current product in context.

date_part

Defined using the following rule:

date_part_ex ::= DP_YEAR | DP_QUARTER |DP_MONTH | DP_WEEK | DP_DAY | DP_DAYOFYEAR | DP_WEEKDAY

Defined time components as per the standard calendar:

  • DP_YEAR - Year of the input date.

  • DP_QUARTER - Quarter of the input date.

  • DP_MONTH - Month of the input date.

  • DP_WEEK - Week of the input date.

  • DP_DAY - Day of the input date.

number

Number of time intervals to add or subtract.

Notes

Based on input date_part and dateroll number, the date is moved forward or backward in time.

Example: For input date June 14, 2005 and input dateroll number 5,

Example

Assume the outline has two date type members, MyDate1 and MyDate2.

Profit=@DateDiff(MyDate1, MyDate2, DP_WEEK);
Profit=@DatePart(MyDate1, DP_YEAR);
MyDate2=@DateRoll(MyDate1, DP_MONTH, 10);

See Also