GetCalendarDate

Mon 01 January 2018

Syntax

GetCalendarDate(comparedate, periods, periodadjustment,outfieldname, company, paygroup)

Description

Use the GetCalendarDate function to return the value of a Date field from the PS_PAY_CALENDAR table. If a table entry is not found, GetCalendarDate returns 1899-01-01.

Parameters

Field or Control

Definition

comparedate

A date field set by the caller as the date of interest, for example, "1997-02-17."

periods

A numeric variable set by the caller specifying the number of periods forward or backward to be returned.

periodadjustment

A numeric variable that adjusts the periods if the comparedate equals the period end date. This is typically used to adjust for period end dates. Usually the periodadjustment is either -1, 0, or 1.

outfieldname

The name of a date field in the PS_PAY_CALENDAR table. For example PAY_BEGIN_DT. The value of this field is not referenced or modified by the routine, but the name of the field is used to build a SQL SELECT statement and to indicate which value from the table to return in the return date.

company

A field set by the caller to be equal to the company code of interest, for example, "CCB".

paygroup

A variable set by the caller to be equal to the PayGroup code of interest, for example, "M01".

Returns

Returns a Date value from the PS_PAY_CALENDAR table.