declare @StartDate smalldatetime, @EndDate smalldatetime set @StartDate = '2013-12-30' set @EndDate = '2014-02-02' select dateadd(day,number+1,@StartDate) as DateId from master..spt_values where type = 'P' and dateadd(day,number+1,@StartDate) < @EndDateOutput :
DateId 2013-12-31 00:00:00 2014-01-01 00:00:00 2014-01-02 00:00:00 2014-01-03 00:00:00 2014-01-04 00:00:00 2014-01-05 00:00:00 2014-01-06 00:00:00 2014-01-07 00:00:00 2014-01-08 00:00:00 2014-01-09 00:00:00 2014-01-10 00:00:00 2014-01-11 00:00:00 2014-01-12 00:00:00 2014-01-13 00:00:00 2014-01-14 00:00:00 2014-01-15 00:00:00 2014-01-16 00:00:00 2014-01-17 00:00:00 2014-01-18 00:00:00 2014-01-19 00:00:00 2014-01-20 00:00:00 2014-01-21 00:00:00 2014-01-22 00:00:00 2014-01-23 00:00:00 2014-01-24 00:00:00 2014-01-25 00:00:00 2014-01-26 00:00:00 2014-01-27 00:00:00 2014-01-28 00:00:00 2014-01-29 00:00:00 2014-01-30 00:00:00 2014-01-31 00:00:00 2014-02-01 00:00:00
0 komentar:
Posting Komentar