Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grouping Question 1

Status
Not open for further replies.

1994mkiv

Technical User
May 24, 2007
28
US
I am working on a paycheck report and the report has to be grouped for each 2 weeks. I set the grouping and everything is working correctly except CR is grouping wrong weeks. CR might be grouping week 1 and 2 together but the way my company payroll works it has to be 2 and 3 together. Can somebody tell be how can I set this kind of grouping.
 
Try the following. Create a formula:

numbervar biwks := remainder(datepart("ww",{table.date}),2);
if biwks = 1 then
{table.date} - dayofweek({table.date}) - 6 else
if biwks = 0 then
{table.date) - dayofweek({table.date}) + 1

Insert your group on this formula. If that gives you the wrong set of weeks, switch the 0 and 1 (the value of biwks).

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top