Datetime in where clause

前端 未结 6 852
终归单人心
终归单人心 2020-12-13 08:15

How can I select 12/20/2008 in where clause of sql?

The server is SQL server 2005.

select * from tblErrorLog
where errorDate = \'12/20/2         


        
6条回答
  •  有刺的猬
    2020-12-13 09:01

    select * from tblErrorLog
    where errorDate BETWEEN '12/20/2008' AND DATEADD(DAY, 1, '12/20/2008')
    

提交回复
热议问题