On Tue, 1999-09-28 22:37:08 +0700, Aldrian Gintingsuka wrote:
> How about having the week function returning a value relative to a certain
> week('1981-12-31,1,1981) -> 53
> week('1982-01-01,1,1981) -> 53
> week('1981-12-31,1,1982) -> 0
> week('1982-01-01,1,1982) -> 0
Plus taking the moon phase into account, too? ;-)
Seriously, no, I don't think this is good an idea!
This year parameter only makes sense with the current year and the
following or previous year, so a parameter with possible values -1, 0,
or 1, meaning relative to last year, this year, next year, would make
a little bit more sense. But even then, this parameter only makes
sense for the few days at the very beginning and end of year, so it's
a _very_ special parameter and doesn't fit that good into a general
week function. And last but not least, as I see it you easily can
deal with a week 0 and transform that to whatevery you like, because
it's meaning is clear - so the current functionality is quite usable!
For example, if your eally want to map week 0 to 53, you might use
IF( WEEK(datefield)=0, 53, WEEK(datefield) )
Besides being a little bit longish it's easy.
Martin Ramsch <m.ramsch@stripped> <URL: http://home.pages.de/~ramsch/ >
PGP KeyID=0xE8EF4F75 FiPr=52 44 5E F3 B0 B1 38 26 E4 EC 80 58 7B 31 3A D7