How to sum data week wise in MS-SQL 2000
I have a Table “Reports” with the following columns.
TotalSubmissions, ZoneID, RptMonth, RptDay, RptYear
2,1,6,1,2010
1,1,6,2,2010
1,1,6,3,2010
1,2,6,1,2010
1,2,6,2,2010
2,2,6,3,2010
1,2,6,4,2010
1,4,6,1,2010
1,4,6,3,2010
1,4,6,4,2010
I want to make a report week wise for a specific zone from DateRange1 to DateRange2
Example: I need Sum of Submissions week wise for zone2 from 06/01/2010 to 06/24/2010.
Please help me to achieve the above task.
Regards,
Mehboob Khan Afridi
I think this will do what you want.
I’ve included some sample data for testing.