Subject: | |
From: | |
Reply To: | |
Date: | Tue, 7 Jan 2003 12:14:53 -0800 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Tom Emerson writes
On Tuesday 07 January 2003 9:23 am, Michael Anderson wrote:
>
> Without thinking about it, so I could be mistaken, this is where I
> would start.
>
> :SETVAR MYWEEKOFYEAR (HPDOY / 7) + 1
> :ECHO !MYWEEKOFYEAR
>
> 2
>
> This logic should get you through this year. However, it's probably
> more reasonable to make the '+ 1' into a variable, that is set to 1 or 0
> depending on if the 7th of Jan is part of the 1st week of the year or
> not.
The thing that mucks this up is the determination of "week 1" -- there is a
business rule or two that might be a cause of conflict. One rule I've heard
is the first week of the year is the "first week to contain a ..." [monday,
friday, sunday -- pick one...] an alternative rule is that the first week is
the first sunday-to-saturday stretch with 4 or more january days in it, so
if
the week "begins" on a thursday, friday, or saturday, it really is/was "part
of last year"...
-----------------------------------------------------
A variation on that rule that we use at Guess? is that is up to 9 day week.
If Jan 1 is a Saturday or Sunday, week 1 is 9 or 8 days long.
Mike Berkowitz
Guess? Inc.
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|
|
|