I need to create a report where I need the sum of UserHits by week, starting from the first week to the last week of a specific year.
How to achieve this?
http://sqlfiddle.com/#!6/eb181/1/0
CREATE TABLE UserData
(
DateCreated dateTime2 NOT NULL,
UserHits int NOT NULL
);
insert into UserData
values
('2014-01-01',100),
('2014-01-02',50),
('2014-01-03',20),
('2014-01-20',100),
('2014-01-21',100),
('2014-01-22',70),
('2014-02-02',100),
('2014-02-03',100);