MS SQL Date Only Without Time

后端 未结 12 1590
有刺的猬
有刺的猬 2020-12-13 02:02

Question

Hello All,

I\'ve had some confusion for quite some time with essentially flooring a DateTime SQL type using T-SQL. Essentially, I want to take a

12条回答
  •  北荒
    北荒 (楼主)
    2020-12-13 02:34

    WHERE DATEDIFF(day, tstamp, @dateParam) = 0
    

    This should get you there if you don't care about time.

    This is to answer the meta question of comparing the dates of two values when you don't care about the time.

提交回复
热议问题