CalRange function

The CalRange function returns a set of valid time stamps within a range.

Syntax

CalRange(cal_name                lvarchar, 
        begin_stamp    datetime year to fraction(5), 
        end_stamp          datetime year to fraction(5)) 
returns list(datetime year to fraction(5));

CalRange(cal_name                lvarchar, 
        begin_stamp    datetime year to fraction(5), 
        num_stamps          integer) 
returns list(datetime year to fraction(5));
cal_name
The name of the calendar.
begin_stamp
The begin point of the range. Must be no earlier than the first time stamp in the calendar.
end_stamp
The end point of the range.
num_stamps
The number of time stamps to return.

Description

The first syntax specifies the range as between two given time stamps. The second syntax specifies the number of valid time stamps to return after a specified time stamp.

The equivalent API function is ts_cal_range().

Returns

A list of time stamps.

Example

The following query returns a list of all the time stamps between 2011-01-03 and 2011-01-05 in the calendar daycal:
execute function CalRange('daycal', 
      '2011-01-03 00:00:00.00000',
      '2011-01-05 00:00:00.00000'::datetime year
          to fraction(5));
The following query returns a list of the two time stamps that follow 2011-01-03 in the calendar daycal:
execute function CalRange('daycal', 
   '2011-01-03 00:00:00.00000', 2);