You can create an expression which gives you a week number for any date.

(INT((Datecolumn - '1/1/1980') / 7))

The literal date determines the starting day for the week.  Test using IDWK
function.

Use this in a view and you will almost have what you want.

If you want week 0 to be the first 7 days in the year then

(INT(((Datecolumn -1) -
(RDATE(IMON(Datecolumn),IDAY(Datecolumn),IYR4(Datecolumn)))) / 7 ))

will give you that. Note the IYR4 funtion.  Have fun.

-- Dennis McGrath
mailto:[EMAIL PROTECTED]

-- Productivity Tools for R:Base Programmers
http://www.enteract.com/~mcgrath/dennis

-- Full time consultant with:
SQL Resources Group
Steve Hartmann
Oak Park, IL
mailto:[EMAIL PROTECTED]



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of David Ebert
Sent: Thursday, October 11, 2001 12:43 PM
To: [EMAIL PROTECTED]
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


Reply via email to