@HspDateRoll

This function returns the next date, resulting from adding noOfPeriods to startDate.

Syntax

@HspDateRoll(startDate,noOfPeriods,periodType)
Parameter Description
startDate The Start date from which the date has to be rolled. It must be type date.
noOfPeriods The number of periods. If given a negative value, the date is rolled back. This must be an integer.
periodType The Period type is an integer where:
  • 1, date roll by days

  • 2, date roll by months

  • 3, date roll by quarter

  • 4, date roll by half year

  • 5, date roll by year

Notes

The return value is a date in YYYYMMDD format.

The start date can be a date in YYYYMMDD format, a variable, or an actual date value.

Example

This example forwards the roll date by 1 month.

@HspDateRoll(20100101,1,2)

This returns 20100201.

Example

This example gets the date one quarter prior to 20101001.

@HspDateRoll(20100101,-1,3)