sql - Output Sum of some column in week intervals throughout a year, week dates consistent with day -
I need some help because I'm stuck. It is using SQL and ColdFusion. Basically I have a table that meets certain tickets in which they mark the entire date. This table is for example district and area, which is used in Group BY. That's why I have to look at every ticket that was done every week of the year, for example the user selects to run the report. I will list a little bit of SQL at this time. SAM (case when DATEPART (ww, closing date)
SELECT SUM (when case pain (ww, closing date) = 1 THEN 1 ELSE 0 END) [January 1-7] ) As of [January 8-14], as SM (case when DATEPART (ww, closing date) = 3 THEN 1 ELSE 0 END) [January 15-21], SM ( As the case when DATEPART (ww, closing date) = 4 THEN 1 ELSE 0 END) [January 22-31] SM (case when DATEPART (ww, closing date) = 5 THEN 1 ELSE 0 END) [February 1-7], SUM (case when DATEPART (ww, closing date) = 6 THEN 1 ELSE 0 END [February 8-14], SM (case when DATEPAR T (ww, closing date) = 7 THEN 1 ELSE 0 END as [February 15-21], SM (case when DATEPART (ww, closing date) = 8 THEN 1 ELSE 0 END) AS [Feb22-28] , As you can see, I am trying to capture the original week of this year and it was a brief closing date in its own column. It should be in this format unless there is no better suggestion. For example, for example, for example, 2/18/2013 for example, SQL is telling me that this will be the 8th week of 2013, whereas my code will be SUM that in FB 15-21, according to my code 7 It's the week. The report I need is to display the month in the top headers, and then show in the next headline of that month each week, then calculate each ticket originally completed that week. Then the weeks / months should have columns.
I have read some CF works and everyone, but I'm not sure what I will need. Is this a way to either dynamically submit dates, to ensure that they are Sumy in the right column on weekends, or use coldfews to handle this part? But I'm also not convinced even on the cold fusion part, so if possible, any suggestions on using SQL or CF and maybe to really help me in the code part will really be appreciated.
Thanks
I recommend creating a database table where the primary key is Date Other fields in this table include the week's string (7th January - 13th) plus some more, holidays, financial information, etc., which you need.
You will need a maintenance script for some things and you have to manually make the holidays manually. We do this with our data warehouse.
This report that you are currently trying to simplify
Comments
Post a Comment