0
我努力做到以下幾點:的DateTime操作EXECUTE sp_executesql的
EXECUTE sp_executesql
N'SELECT TOP 10 * FROM dbo.Items WHERE DateCreated BETWEEN @start AND @end'
, N'@start DATETIME, @end DATETIME'
, @start = '20091001'
, @end = GETDATE() --problem is caused by this line
Error:
Msg 102, Level 15, State 1, Line 5
Incorrect syntax near ')'.
我需要操作的日期,並把它作爲參數,即週一的一週,一年中的月份等。它甚至有可能嗎?
謝謝。
好極了!謝謝。 – 2013-09-24 08:14:05