SQL获取某个时间段的数据
declare @beginDate datetime
declare @endDate datetime
set @beginDate = '2010-11-1'
set @endDate = '2011-1-2'
create table #temp(ids int identity(1,1), 日期 nvarchar(10))
declare @i int
set @i = 0
while @i <=datediff(dd,@beginDate,@endDate)
begin
insert into #temp
select convert(nvarchar(11), dateadd(dd,@i,@beginDate),120)
set @i = @i +1
end
select * from #temp