ComponentOne True DBInput Pro 8.0
DatesInRange Method (TDBHolidayX)

 

Reference> TDBHolidayX Object> TDBHolidayX Object Methods> DatesInRange Method (TDBHolidayX)

DatesInRange Method (TDBHolidayX)

The DatesInRange method retrieves all of the holidays, weekends or working days. This method comes in handy when you need all of the working days or holidays in the month.

Syntax

object.DatesInRange ([Date1], Date2, Array, [Type])

Arguments

date1 is an optional Variant(Date), that is beginning date of the range. When not specified, the date in the Value property will be used.

date2 is a required Variant(Date) that is the ending date of the range.

array is a required variant: pass in a variable defined as a variant type, and the method will return an array of dates.

type is an optional constant. Specify the type of day (holidays/workdays) to retrieve. When not specified, holidays will be retrieved by default.

Valid settings for the type argument are:

0

Holiday (Default)

1

Workday

2

Weekend

Return Value

An integer representing the number of elements retrieved in the array argument. If 0 or greater, the call was successful; if -1, the call failed because either date1 or date2 was Null.

Remarks

The array variable that is passed as the third argument should not be declared as an array type. The correct way of defining the variable is as following:

Dim DateArray As Variant

DatesInRange(..., ..., DateArray, ...)

Limitation: The span range between date1 and date2 can not be set larger than 1000 years. It may effect the speed.

See Also

DaysFromNow Method (TDBHolidayX)

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback