ComponentOne True DBInput Pro 8.0
DaysFromNow Method (TDBHolidayX)

 

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

DaysFromNow Method (TDBHolidayX)

Returns the new date that has been calculated. The DaysFromNow method is used to retrieve a date so many days before or after from the specified date. When the days argument is a positive value days will be added, and days will be calculated backwards when the argument is a negative value. This method can be used when making a program related with schedules.

Syntax

object.DaysFromNow ([Date], Days, [Type])

Arguments

date is an optional variant that specifies the base date, and days will be calculated from this date on. When not specified, the date in the Value property will be used.

days is a required integer that specifies the amount of days to count ahead or before. When a negative value is defined, days before will be counted.

type is an optional constant that specifies the type of day (holidays/workdays) to count. When not specified, holidays will be count by default.

Valid settings for the type argument are:

0

Holiday (Default)

1

Workday

2

Holiday or Weekend

Return Value

A date value representing the calculated offset, or Null if the passed-in date was Null or the specified type of days was not found.

Remarks

When a negative value is specified for the days argument this method will behave as follows:

StartDate = CDate("1998/3/22") ' a Sunday

TmpDate = TDBHolidayX.DaysFromNow(StartDate,-5,dbiWorkday)

' TmpDate contains 1998/3/16, a Monday

See Also

DatesInRange Method (TDBHolidayX)

DaysInRange Method (TDBHolidayX)

 

 


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

Product Support Forum  |  Documentation Feedback