I have records related to dates:
DATE AMOUNT
16.03.2013 3
16.03.2013 4
16.03.2013 1
16.03.2013 3
17.03.2013 4
17.03.2014 3
I guess this would help as well....
/* Weekly sum of values */
SELECT SUM( Amount ) as Sum_Amt,
DATEPART (wk, Date) as WeekNum
FROM databse_name.table_name
GROUP BY DATEPART (wk, Date)
ORDER BY WeekNum
/* Monthly sum of values */
SELECT SUM( Amount ) as Sum_Amt,
DATEPART (mm, Date) as MonNum
FROM databse_name.table_name
GROUP BY DATEPART (mm, Date)
ORDER BY MonNum