CalStamp function

The CalStamp function returns the time stamp at a specified number of calendar intervals after a specified time stamp.

Syntax

CalStamp(cal_name    lvarchar, 
         tstamp      datetime year to fraction(5), 
         num_stamps  integer) 
returns datetime year to fraction(5);
cal_name
The name of the calendar.
tstamp
The input time stamp.
num_stamps
The number of calendar intervals before or after the input time stamp. Use a negative number to indicate an offset before the specified time stamp and a positive number to indicate an offset after the specified time stamp.

Description

The equivalent API function is ts_cal_stamp().

Returns

The time stamp that represents the specified offset.

Example

The following example returns the time stamp that is two intervals after 2011-01-03:
execute function CalStamp('daycal', 
   '2011-01-03 00:00:00.00000', 2);