esings2him
Programmer
I am working on a report that shows the open order cash commitment for po's and I would like to group them by week and by month. My "by month" formula works when the user chooses that from the parameter; however, my "by week" parameter is a hit and miss. I would the like data below to display the Monday of the week as a header and the week should be Monday-Sunday. Currently, I have two group headers-the first one is on the table date to get the years to sort correctly, then I have the formula of the by week and by month. I created a summary field to display the minimum date next to the "Week of" thinking that would give me the first day of the week, but, clearly, I was wrong since the date, usually, isn't a Monday. How can I modify the formula to display the information that I'm wanting?!! Any help would be appreciated!
//@Date Period formula
IF {?Date Period} = "By Week" THEN
DATEPART("ww", {PORel.DueDate}, crMonday)
ELSE IF {?Date Period} = "By Month" THEN
DATEPART("m", {PORel.DueDate})
Week Of 05/01/2010Should be Week of 4/26/2010
5/1/2010 2890 1 1 24.00 0.00 24.00 $386,208.80
Week Of 05/17/2010 This is correct
5/17/2010 2528 1 1 1.00 0.00 1.00 $387,873.80
5/21/2010 2899 3 2 12.00 0.00 12.00 $411,873.80
Week Of 06/30/2010 Should be Week of 6/28/2010
6/30/2010 3433 1 1 36.00 5.00 31.00 $441,323.80
Week Of 08/19/2010 Should be Week of 8/16/2010
8/19/2010 3632 1 1 1.00 5.00 -4.00 $436,523.80
8/20/2010 3321 1 1 44.00 5.00 39.00 $436,796.80
8/20/2010 3617 1 1 2.00 5.00 -3.00 $435,928.54
//@Date Period formula
IF {?Date Period} = "By Week" THEN
DATEPART("ww", {PORel.DueDate}, crMonday)
ELSE IF {?Date Period} = "By Month" THEN
DATEPART("m", {PORel.DueDate})
Week Of 05/01/2010Should be Week of 4/26/2010
5/1/2010 2890 1 1 24.00 0.00 24.00 $386,208.80
Week Of 05/17/2010 This is correct
5/17/2010 2528 1 1 1.00 0.00 1.00 $387,873.80
5/21/2010 2899 3 2 12.00 0.00 12.00 $411,873.80
Week Of 06/30/2010 Should be Week of 6/28/2010
6/30/2010 3433 1 1 36.00 5.00 31.00 $441,323.80
Week Of 08/19/2010 Should be Week of 8/16/2010
8/19/2010 3632 1 1 1.00 5.00 -4.00 $436,523.80
8/20/2010 3321 1 1 44.00 5.00 39.00 $436,796.80
8/20/2010 3617 1 1 2.00 5.00 -3.00 $435,928.54