Group data by custom weeks

  • Thread starter Thread starter Gil D.
  • Start date Start date
G

Gil D.

Hello,


My user gives me startDate and finishDate as input.
I want to group my data by weeks where:
First week first day is startDate
Last week last day is finishDate

Can I do it by a query ?

Thank you for yuor help
Gil D.
 
Hello,


My user gives me startDate and finishDate as input.
I want to group my data by weeks where:
First week first day is startDate
Last week last day is finishDate

Can I do it by a query ?

Thank you for yuor help
Gil D.

You'll have to explain. What exactly do you want to group by? Week No.
1, Week No. 2? What if the range is not a multiple of 7? Could you
give an example of the data and how you would like it displayed?

John W. Vinson[MVP]
 
Hello,

I have a table named: Work
Each record contains workerID, workingDate, working hours etc.
I am trying to create a weekly chart/report.
My user give me as input: startData, endDate.

If Diff(startData, endDate) => 7 then
First week is: startDate,startDate+6
Second week is: startDate+7, startDate+13
....

If the range is not a multiple of 7 then last week will be shorter.
I need to display for my user weeks starting/ending date.

Example of the data and how you would like it displayed:

workerID, workingDate, working hours
1, 11/12/05, 10
2, 11/12/05, 10
1, 18/12/05, 5

User input:
startDate 11/12/05
endDate 22/12/05

Needed Output:
weekStartDate, weekEndDate, SumOfWorkingHours
11/12/05, 17/12/05, 20
18/12/05, 22/12/05, 5

Thank you for your help
Gil D.
 
Back
Top