FT_ACCTYEAR()
Return accounting year data
──────────────────────────────────────────────────────────────────────────────

Syntax

FT_ACCTYEAR( [ <dGivenDate> ] ) -> aDateInfo

Arguments

<dGivenDate> is any valid date in any date format. Defaults
to current system date if not supplied.

Returns

A three element array containing the following data:

aDateInfo[1] - The year as a character string "YYYY"
aDateInfo[2] - The beginning date of the accounting year
aDateInfo[3] - The ending date of the accounting year

Description

FT_ACCTYEAR() creates an array containing data about the
accounting year containing the given date.

An accounting period has the following characteristics:

If the first week of the period contains 4 or more 'work'
days, it is included in the period; otherwise, the first
week was included in the prior period.

If the last week of the period contains 4 or more 'work'
days it is included in the period; otherwise, the last week
is included in the next period. This results in 13 week
'quarters' and 4 or 5 week 'months'. Every 5 or 6 years, a
'quarter' will contain 14 weeks and the year will contain 53
weeks.

Examples

// get info about accounting year containing 9/15/90
aDateInfo := FT_ACCTYEAR( CTOD("09/15/90") )
? aDateInfo[1] // 1990
? aDateInfo[2] // 12/31/89 beginning of year
? aDateInfo[3] // 12/29/90 end of year

Source: ACCTYEAR.PRG

Author: Jo W. French dba Practical Computing