Want to get data on weekly basis
-
Hi guys, I want to plot a graph that shows weekly data for total year of total number of issues and solved issues. So yearly will have 52 weeks. My financial year will start every year October to next year September end. EX my Financial year 2012-13 Start date will be 01/10/2012 end date will be 30/09/2013. Any help will be appreciated. Thanks and regards Vishwa
-
Hi guys, I want to plot a graph that shows weekly data for total year of total number of issues and solved issues. So yearly will have 52 weeks. My financial year will start every year October to next year September end. EX my Financial year 2012-13 Start date will be 01/10/2012 end date will be 30/09/2013. Any help will be appreciated. Thanks and regards Vishwa
Look into DATEPART that will give you the week number of the date within the year. Count the issues and group by the week datepart
Never underestimate the power of human stupidity RAH
-
Hi guys, I want to plot a graph that shows weekly data for total year of total number of issues and solved issues. So yearly will have 52 weeks. My financial year will start every year October to next year September end. EX my Financial year 2012-13 Start date will be 01/10/2012 end date will be 30/09/2013. Any help will be appreciated. Thanks and regards Vishwa
Sum up want ever you want and make group by with datepart.
-
Sum up want ever you want and make group by with datepart.
-
ok..Post the Query..
-
ok..Post the Query..
SELECT DATEPART(YEAR,trans_date) AS 'Year',DATEPART(wk,trans_date) AS 'Week #',MIN(DATEADD(wk, DATEDIFF(wk,0,trans_date), 0)) AS 'Week date', SUM(COALESCE(debit,0)) AS 'Debits', SUM(COALESCE(credit,0)) AS 'Credits' FROM trans GROUP BY DATEPART(YEAR,trans_date),DATEPART(wk,trans_date)ORDER BY 1,2;