I am trying to run a yearly report (manual crosstab) that is broken down into weeks. I have to parameters "begdate" and "enddate". The report will start with the begdate and run each week until the enddate. It is summing unit cost. Basically I want it to look like this:
Week Cost
04/05/04 - 04/11/04 96.24
04/12/04 - 04/18/04 192.84
04/19/04 - 04/25/04 144.36
etc.
I just can't seem to get it to work. I used datediff to figure out the total number of weeks and dateadd to get each weekly period. The table I am pulling from has a date associated with each cost (servicedate). I am not sure how the begdate, enddate and service date all fit in the formulas.
Week Cost
04/05/04 - 04/11/04 96.24
04/12/04 - 04/18/04 192.84
04/19/04 - 04/25/04 144.36
etc.
I just can't seem to get it to work. I used datediff to figure out the total number of weeks and dateadd to get each weekly period. The table I am pulling from has a date associated with each cost (servicedate). I am not sure how the begdate, enddate and service date all fit in the formulas.