For anyone who doesn't have the new IWK function available, this will give you the 
calendar week, ending on Sunday, for any date. First reply figuring out the logic AND 
describing it in clear English AND altering it to return calendar weeks ending on 
Saturday will up my conference ante by $10, attributed to her/him.  

SET VAR vDate DATE
SET VAR vWeek INTEGER
SET VAR vDate = <any date>
SET VAR vWeek = (((MOD(JDATE(.vDate),1000)) + 7 - IDWK(.vDate))/7)



Tom Grimshaw <[EMAIL PROTECTED]> wrote:

>G'day,
>
>Like Troy, I've gone the table route on this one.
>
>I have a table called WE_WK_BP in the database
>(week ending, no of week in year, bonus period)
>that I populate for the next 20 years for a new client
>as well as giving them the ability to add, modify the data..
>
>I supply the text files for each day of the week so if they change their
>week ending day at some point they can update the table from the
>text files for all values past a nominated start date.
>
>I anyone wants the text files and code drop me a line.
>
>At 03:14 PM 11/10/2001 -0600, you wrote:
>>To do these types of reports, I build a table that has:
>>The date - 1/1/01, 1/2/01....
>>Week Num
>>Month Num
>>Day Num
>>maybee qtr_num
>>
>>Write a small program that goew through and populates it for you going out 5
>>years or so.
>>
>>Now, buld a view between you original table, link on the date, and group on
>>week num.
>>
>>Troy
>>
>>===== Original Message from [EMAIL PROTECTED] at 10/11/01 1:33 pm
>> >I seem to remember a convention that week 1 of a year contains the first
>> >Thursday of the year. I don't know why.
>> >
>> >Bill Cook
>> >Kent WA USA
>> >
>> >----- Original Message -----
>> >From: "David Ebert" <[EMAIL PROTECTED]>
>> >To: <[EMAIL PROTECTED]>
>> >Sent: Thursday, October 11, 2001 10:42 AM
>> >Subject: need an IWK
>> >
>> >
>> >> I've been asked to produce a report on an ongoing basis that reports, by
>> >> week for a given month, certain productivity stats.
>> >>
>> >> The weekly part has me stumped.  The best I can think of is an
>> >> annually-updated 52 row table, but the "annually-updated" is a flop
>> >waiting
>> >> to happen.
>> >>
>> >> Can I say logically that a given date falls in week (n) in any given year?
>> >>
>> >> tia
>> >>
>> >> Dave
>> >>
>
>Warmest regards,
>
>
>Tom Grimshaw
>coy:    Just For You Software
>tel:    612 9552 3311
>fax:    612 9566 2164
>mobile: 0414 675 903
>
>post:   PO Box 470  Glebe  NSW  2037  Australia
>street: 3/66 Wentworth Park Rd  Glebe  NSW  2037
>
>email:  [EMAIL PROTECTED]
>web: www.just4usoftware.com.au
>
>This email and any files transmitted with it are confidential to the 
>intended recipient and may be privileged. If you have received this email 
>inadvertently or you are not the intended recipient, you may not 
>disseminate, distribute, copy or in any way rely on it. Further, you should 
>notify the sender immediately and delete the email from your computer. 
>Whilst we have taken precautions to alert us to the presence of computer 
>viruses, we cannot guarantee that this email and any files transmitted with 
>it are free from such viruses.
>
>


__________________________________________________________________
Your favorite stores, helpful shopping tools and great gift ideas. Experience the 
convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/

Reply via email to