WeekOfYearFiscal()

 <  Day Day Up  >  

WeekOfYearFiscal()

Category: Date

Syntax: WeekOfYearFiscal ( Date ; StartingDay )

Parameters: Date ”any valid date (1/1/0001 “12/31/4000). The parameter should be a string containing a date (for example, "3/17/2004" ), an expression with a date result (for example, Date (6, 29, 1969) ), or an integer that represents a serialized date value (for example, 718977 ). StartingDay ”a numeric value between 1 (Sunday) and 7 (Saturday).

Description: The WeekOfYearFiscal() function returns an integer from 1 to 53 that represents the week number of the year of the specified date. Weeks are defined as starting on the day of week specified by the StartingDay parameter.

The first week of a year is defined as the first week that contains four or more days of that year. For instance, January 1, 2004 was a Thursday. Using a StartingDay of 5, the first fiscal week of the year would be considered as 1/1/2004 through 1/7/2004. The second fiscal week would begin on Thursday, 1/8/2004. However, if you used a StartingDay of 1 (Sunday), then the first day of the fiscal year would be 1/4/2004. In the previous week (12/28/03 “1/3/2004), only three days are in 2004, so that would be considered as the 53rd fiscal week of 2003.

Examples:

 

 WeekOfYearFiscal ("3/21/2004", 4) 

Returns 12 .

 

 WeekOfYearFiscal ("1/1/2004", 1) 

Returns 53 .

 

 WeekOfYearFiscal ("1/1/2004", 2) 

Returns 1 .

Comments:

WeekOfYearFiscal() and WeekOfYear() often yields different results. WeekOfYear() is always based on a week defined as Sunday through Saturday, whereas WeekOfYearFiscal() can begin on whatever day you specify. Even when it begins on Sunday, however, you might have discrepancies because of the rule that the first week must have four or more days in the current year. Whereas WeekOfYearFiscal("1/1/2004") returns 53, WeekOfYear("1/1/2004") returns 1.

 <  Day Day Up  >  


QUE CORPORATION - Using Filemaker pro X
QUE CORPORATION - Using Filemaker pro X
ISBN: N/A
EAN: N/A
Year: 2003
Pages: 494

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net