这个SQL查询无法正常工作。为什么?

时间:2017-11-08 11:28:34

标签: sql sql-server

SELECT * FROM E_AracTemizlikTakipSureci_Form 
WHERE txtKayitTarihi >= '2017-11-08' AND txtKayitTarihiBitis <= '2017-11-08';

此查询无法在sql server上运行。

1 个答案:

答案 0 :(得分:-4)

尝试将日期投射为相同的格式

SELECT * FROM E_AracTemizlikTakipSureci_Form 
WHERE CAST(txtKayitTarihi AS DATE) >= CAST('2017-11-08' AS DATE) AND CAST(txtKayitTarihiBitis AS DATE) <= CAST('2017-11-08' AS DATE);