How to change the query to give last 15 weeks of data instead of last 15 days from the SQL Server
问题 The following query gives playing time of the users from the database on daily basis for the last 15 days. It adds 0 if no game is played. Now I want to get the data of playing time on weekly basis and 0 if no game is played in the whole week. So I want the query to give the last 15 weeks of data. Here is the daily query. CREATE PROCEDURE [dbo].[spGetPlayingTimeOfthepeoplesPerDay] @email NVARCHAR(50) AS BEGIN SET NOCOUNT ON; DECLARE @MinDate DATE ,@MaxDate DATE ,@LastXDays INT SELECT