-1
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
4

1 回答 1

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
于 2013-03-06T20:13:12.027 回答