` Printed Icetips Article

Icetips Article



Par2: Week of year
2001-01-17 -- Julian Martin
 
> How can I determine what week no of the year we are in?

!Assumes that Week 1 is defined as 1-7 January.
DayOfYear# = (TODAY() - DATE(12, 31, YEAR(TODAY()) - 1))

!Compensates for the lack of a ceiling() which I'm sure used to be in
clib
IF DayOfYear# % 7
    WeekNo# = (DayOfYear# + (7 - (DayOfYear# % 7))) / 7
ELSE
    WeekNo# = DayOfYear# / 7
END

MESSAGE('We are now in Week Number ' & WeekNo#)



Printed November 23, 2024, 8:17 pm
This article has been viewed/printed 35213 times.