SELECT '(Current Week)'
UNION SELECT Convert(varchar, dbo.firstOfWeek(DateAdd(dd, -7, GetDate()), default), 101)
UNION SELECT Convert(varchar, dbo.firstOfWeek(DateAdd(dd, -14, GetDate()), default), 101)
UNION SELECT Convert(varchar, dbo.firstOfWeek(DateAdd(dd, -21, GetDate()), default), 101)
UNION SELECT Convert(varchar, dbo.firstOfWeek(DateAdd(dd, -28, GetDate()), default), 101)
UNION SELECT Convert(varchar, dbo.firstOfWeek(DateAdd(dd, -35, GetDate()), default), 101)
UNION SELECT Convert(varchar, dbo.firstOfWeek(DateAdd(dd, -42, GetDate()), default), 101)
order by 1
答案 0 :(得分:0)
我认为你的意思是:
SELECT '(Current Week)'
UNION SELECT Convert(varchar, DateAdd(dd, -7, GetDate()), 101)
UNION SELECT Convert(varchar, DateAdd(dd, -14, GetDate()), 101)
UNION SELECT Convert(varchar, DateAdd(dd, -21, GetDate()), 101)
UNION SELECT Convert(varchar, DateAdd(dd, -28, GetDate()), 101)
UNION SELECT Convert(varchar, DateAdd(dd, -35, GetDate()), 101)
UNION SELECT Convert(varchar, DateAdd(dd, -42, GetDate()), 101)
order by 1
(Current Week)
01/23/2013
01/30/2013
02/06/2013
02/13/2013
02/20/2013
02/27/2013