DatesFromPeriod

ACCPAC Common Controls

AccpacFiscalCalendar.DatesFromPeriod

Calculates the period start and end dates, given a period number, type, and length, and a base date.

Function DatesFromPeriod(
  Period As Integer,
  PeriodType As tagPeriodType,
  PeriodLength As Integer,
  BaseDate As Date,
  StartDate As Date,
  EndDate As Date) As Boolean

Parameters

Period

[in] the period number

PeriodType

[in] the period type

PeriodLength

[in] the period length

BaseDate

[in] the starting date of the first period

StartDate

[out] returns the period's start date

EndDate

[out] returns the period's end date

Return Value

Returns whether the start and end dates were successfully determined.

Remarks

Use a combination of period type and length to denote additional period types.

Examples:

  • Bimonthly:
    PeriodType = PERTYPE_MONTHLY, PeriodLength = 2

  • Biweekly (with Sunday = day 1):
    PeriodType = PERTYPE_WEEKLY, PeriodLength = 14