select dateadd(day,number,convert(date,dateadd(DD,-6,getdate()),23)) as RQ from master.dbo.spt_values where type ='P'and number <=DATEDIFF(day, convert(date,dateadd(DD,-6,getdate()),23), GETDATE())