2010-10-21 56 views
0
SELECT "2 0 Analytical (Testing Phase)" 
    FROM "dbo"."Lab Occurrence Form" 
WHERE (("Occurrence Date" BETWEEN @P1 AND @P2) 
    AND ("2 0 Analytical (Testing Phase)" LIKE ''%2.%'')) ', N'@P1 datetime,@P2 datetime','2010-04-30 00:00:00','2010-04-01 00:00:00' 

這是正確的格式來返回某個日期時間之間的記錄?sql server:這個日期時間會工作嗎?

+1

看起來像'EXEC' /'EXEC sp_executesql',但不太完整...... – 2010-10-21 18:25:05

回答

2

的SQL SELECT語法看起來正確的,但這些參數的日期值應該被交換(在@ P1舊的日期。)

+0

這是問題!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! – 2010-10-21 18:30:30