-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
http://www.sqlfiddle.com – BLSully 2013-03-06 20:03:57
沒有任何的背景下,[它給了一些錯誤(http://www.sqlfiddle.com/# !3/d41d8/10460),這是可以預料的。 – Dukeling 2013-03-06 20:06:04
你們很快就會發現問題並關閉它。至少讓OP有機會澄清他在關閉之前試圖達成的目標。也許在弓上發出警告聲吧? – Tim 2013-03-06 20:16:04