I have written a join query which works perfect and it give me total number of rows between two dates, however is there a way where i can modify my query so that i can see the result on weekly basis from January 2014 to may 2014
;WITH SourceDataas
(
SELECT tablet.Approach.ApproachId
,StartDateTime
,QuestionId, Stage
FROM Tablet.Approach
JOIN tablet.DataCapture ON tablet.Approach.ApproachId = tablet.DataCapture.ApproachId
WHERE QuestionId in (9,10)
and Stage = 2
and StartDateTime between '2014-01-01 00:00:00' and '2014-05-20 00:00:00'
)
,RecordCnt
AS
(
SELECT COUNT(ApproachId) AS TotalInformationEffectContacts
FROM SourceData
)
Select * from SourceData Cross join RecordCnt
order by StartDateTime asc