SELECT DateAdd(day,number,'2014-09-29') FROM master..spt_values WHERE type = 'p' AND number <= DateDiff(day,'2014-09-29',GetDate())
运行结果:
2014-09-29 00:00:00.000 2014-09-30 00:00:00.000 2014-10-01 00:00:00.000 2014-10-02 00:00:00.000 2014-10-03 00:00:00.000 2014-10-04 00:00:00.000 2014-10-05 00:00:00.000 2014-10-06 00:00:00.000 2014-10-07 00:00:00.000 2014-10-08 00:00:00.000 2014-10-09 00:00:00.000 2014-10-10 00:00:00.000 2014-10-11 00:00:00.000 2014-10-12 00:00:00.000 2014-10-13 00:00:00.000 2014-10-14 00:00:00.000