'DATE' is not a recognized built-in function name

前端 未结 5 595
小蘑菇
小蘑菇 2021-01-05 05:12

I wish to find all records of the current day. I have a field Date of type DATE. I am getting error on sql server

\'DATE\' is not a recognized built-in funct         


        
5条回答
  •  爱一瞬间的悲伤
    2021-01-05 05:46

    More efficient one is

    WHERE EnterDate > DATEADD(dd, -1, DATEDIFF(dd, 0, GETDATE()))
    

    Thanks @D Stanley @marc_S and @Mihai

提交回复
热议问题