declare @Today datetime
set @Today = convert(datetime, convert(char(10), getdate(),101))
declare @FullDates Table (SevenDaysAgo)
insert into @FullDates (SevenDaysAgo)
Select FullDate as SevenDaysAgo
from dbo.DimDate
where FullDate >= DATEADD(dd,-7, @Today) and FullDate <= getdate() Select SevenDaysAgo
from @FullDates
Showing posts with label table variable. Show all posts
Showing posts with label table variable. Show all posts
Wednesday, July 8, 2009
Subscribe to:
Posts (Atom)