Syntax: WeekOfYearFiscal ( date; startingDay )
dateAny valid date (1/1/000112/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).
startingDayA numeric value between 1 (Sunday) and 7 (Saturday).
Data type returned: Number
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/031/3/2004), only three days are in 2004, so that would be considered as the 53rd fiscal week of 2003.
WeekOfYearFiscal() and WeekOfYear() often yield 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.
WeekOfYearFiscal ("3/21/2004", 4)
WeekOfYearFiscal ("1/1/2004", 1)
WeekOfYearFiscal ("1/1/2004", 2)
: FileMaker Specifications
FileMaker 8 Product Line
Specifications and Storage Limits
Field Types and Import/Export Formats
: Calculation Functions
Working with Calculations Primer
: Custom Functions
Custom Functions Primer
Useful Custom Functions
: Script Steps
Script Step Reference
: Quick Reference
FileMaker Error Codes
FileMaker Keyboard Shortcuts
FileMaker Network Ports
FileMaker Server Command Line Reference
FileMaker XML Reference
: Other Resources
Where to Go for More Information