April 17, 200322 yr Newbies I can calculate the current week using the following calculation, but I do not complete understand why it works so I cannot make it calcuate last week or the week before that DateToText(Status( CurrentDate) - Middle("6012345", Mod(Status( CurrentDate) - Date(1,3,1904),7)+2,1)) & "..." &DateToText( Status( CurrentDate) - Middle("6012345", Mod(Status( CurrentDate) - Date(1,3,1904),7)+1,1) + 5) The above calc will give me 4/13/2003...4/19/2003, but what I need is calc that if it is a Monday would be the past 2 weeks. The example below. 4/6/2003...4/12/2003 and 3/31/2003..4/5/2003 Any help would be great.
April 17, 200322 yr Give this calc a try. This calc will only evaluate if it is Monday, otherwise the field will be empty. If you need to retain the values, you will need to use a script to set the values in the field. If you use as a calc, select "Do not store calculation results" under storage options. Case( DayofWeek(Status( CurrentDate)) = 2, DateToText(Status( CurrentDate) - 8)&"..."&DateToText(Status( CurrentDate) - 2)&"
April 18, 200322 yr Hi Brian, ThisWeek'sSunday = Status(currentdate) - MOD(DayofWeek(Status(currentdate)) +7-1; 7) will return the 1st day of current week (Sunday in your calc ?) ThisWeek'sSaturday = Status(currentdate) + MOD(7-DayofWeek(Status(currentdate)); 7) will return the last day of current week (Saturday in your calc ?) ThisWeek = DateToText(ThisWeek'sSunday) & "..." & DateToText(ThisWeek'sSaturday) IMHO The past weeks should be PastWeek = DateToText(ThisWeek'sSunday -7) & "..." & DateToText(ThisWeek'sSaturday-7) Past2Week = DateToText(ThisWeek'sSunday -14) & "..." & DateToText(ThisWeek'sSaturday-14) and your calc should be Case(DayofWeek(Status( CurrentDate)) = 2, PastWeek & "
April 18, 200322 yr isn't there a function "week of year"? or "week of fiscal year" just do a calc on all your dated items and use currentweek -1, currentweek -2 and so on ... Of couse, you will have to provide for last week of december ...
April 18, 200322 yr Hi, isn't there a function "week of year"? or "week of fiscal year" This would turn the dates in numbers though.... If you want to display the dates as asked using these functions, you'll lead to circular problems as you will need to re-use the calc based on the date given. If your calc should be based on the week number, then check this post Reversing week dates into regular dates
Create an account or sign in to comment