That link has been updated to:
First create a formula in the main report {@dayofyear}:
(datepart("ww",{xl.Date},dayofweek(date(year({xl.Date}),1,1)),crfirstJan1)-1)*7 +
dayofweek({xl.Date},dayofweek(date(year({xl.Date}),1,1)))
Add this formula as a link to each subreport. Then go into each subreport, and create separate formulas for week number, month, and year, one that references the start date and one, the end date. Also create a SQL expression, e.g., {#DOY-Start}, for each:
{fn dayofyear(`table`.`start`)}
and change the selection formula to the following:
//{@Monday}:
{@Weekno-Start} <= {?Pm-@weeknumber} and
{@Weekno-End} >= {?Pm-@weeknumber} and
{%Month-Start} <= {?Pm-%Month} and
{%Month-End} >= {?Pm-%Month} and
{%Year-Start} <= {?Pm-%Year} and
{%Year-End} >= {?Pm-%Year} and
{%DOY-Start} <= {?Pm-@dayofyear}+1 and
{%DOY-End} >= {?Pm-@dayofyear}+1
Note that the 1 should be removed for Sunday, and should be changed to 2 for Tuesday, 3 for Wednesday, etc., since {Pm-@dayofyear} will always show the dayofyear for Sunday of the specific week.
You should check to make sure that the dayofyear function in your database will match the formula that is used for the Excel spreadsheet by placing the {?PM-{@Dayofyear} and {%DOY-Start} on a Sunday where the start date is a Sunday and making sure they match. You can adjust the formulas as necessary.
-LB