@Week function

Can anyone tell me why Lotus has a @Year, @Month, @Day, @WeekDay function, but no @Week function? Now I have to look up a good old post on the Notes/Domino 4 and 5 forum again. It cannot be so hard for Lotus to implement this I guess, can it??

But anyway, just wanted to get rid of my frustration. Feel free to comment.

Bas

Subject: @Week function

in Postopen-Event of the Form I set a hidden Field using

thisweek = Cstr(Format(Date(),“ww”))

Subject: @Week function

Another solution - (returns 1 - 53 - week starts on Sunday)

_TMP := AC_Date;

@If(!@IsTime(_TMP);@Return(0);“”);

_Start := @TextToTime(“1/1/” + @Text(@Year(_TMP)));

_DiffInDays := @Integer((_TMP - _Start)/86400);

@Integer((_DiffInDays + @Weekday(_Start) - 1)/7) + 1

Subject: RE: @Week function

Excellent solution.Dont know how you figured out to do this weekday adding but its clever.

Thanks

Cedric

Subject: @Week function

Agreethough the logic is less simple than you may think

there is an ISO standard on weeks, (ISO 8601 if I remember correctly) = week 1 is the week that contains the first Thursday is one rule

week starts on Monday is another rule

but local settings vary, whereas week start on mondays or sundays…

I have written a @Formula which gives the ISO 8601 Week number, I could post it here if you are interested )

Subject: RE: @Week function

Hi.

I have been asked to create a view that shows all documents created “this week”. Second I have been asked to create 52 views, one for eatch week during the year. Any help would be greatful.

Subject: RE: @Week function

I think I found a function, but it would be nice if you posted your’s as well.

Perhaps Lotus can consider supplying an @week function with a second parameter for what week (ISO or based on local settings) should be returned.