SQL “between” not inclusive

后端 未结 8 1656
情歌与酒
情歌与酒 2020-11-30 17:05

I have a query like this:

SELECT * FROM Cases WHERE created_at BETWEEN \'2013-05-01\' AND \'2013-05-01\'

But this gives no results even tho

8条回答
  •  离开以前
    2020-11-30 17:48

    cast(created_at as date)
    

    That will work only in 2008 and newer versions of SQL Server

    If you are using older version then use

    convert(varchar, created_at, 101)
    

提交回复
热议问题