Command Reference : String and Date Function Reference
Syntax: @datenext(d1, u[, step])
Argument 1: date number, d1
Argument 2: time unit, u
Argument 3: step, step
Return: date number
Finds the first possible date number for the period following that defined by d1 in the regular frequency defined by the given time unit u and optional step step. The frequency is defined relative to the basedate of Midnight, January 2001.
The valid time unit string values are: “A” or “Y” (annual), “S” (semi-annual), “Q” (quarters), “MM” (months), “WW” (weeks), “DD” (days), “B” (business days), “HH” (hours), “MI” (minutes), “SS” (seconds).
If step is omitted, the frequency will use a step of 1 so that by default, @datenext will find the beginning of the subsequent period defined by the time unit.
Suppose that date1 is 730110.8 (7 PM, December 23, 1999). Then the @datenext values
@datenext(730110.8, "dd")
@datenext(730110.8, "mm")
yield 730111.0 (midnight, December 24, 1999) and 730119.0 (midnight, January 1, 2000), the date numbers for the beginning of the next day and month associated with 730110.8, respectively.
@datenext(730110.8, "hh", 3)
@datenext(730110.8, "hh", 6)
return 730110.875 (9 PM, December 23, 1999), and 730111 (midnight, December 24, 1999), which are the earliest date numbers for the subsequent 3 and 6 hour regular frequencies anchored at Midnight, January 1, 2001.