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
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment