WOY Function for non-calendar weeks

Kenneth Brody kenbrody at spamcop.net
Tue Apr 6 08:14:56 PDT 2010


On 4/6/2010 10:50 AM, Kenneth Brody wrote:
[...]
> Week1    If:  DOY(DateToCheck) le DaysToShift
>          Then:  WeekOfYear = "1"
>            If:  not Week1
>          Then:  WeekOfYear = WOY(DateToCheck - DaysToShift)
>
> In this case, DaysToShift would be 1.  If, for some reason, you had a week
> defined as Tue-Mon for example, you would use 2 instead, and so on.

Actually, thinking this over, the above might not work for DaysToShift 
greater than 1.  I'd have to sit down and double-check it.

-- 
Kenneth Brody


More information about the Filepro-list mailing list