About this question
I have a column called create date of a DateTime datatype. I want to extract data between today and yesterday. select * from table1(no lock) where createdate ='2018-06-01' --not getting any output I want something like this:
select * from table1(no lock) where createdate between '2018-06-01' and '2018-06-02' Rather than hard coding the date, I need between dateadd(d,-1,getdate()) and getdate(), but getdate() gives current timestamp. How can I search for the whole day like 2018-06-02 rather than 2018-06-02 02:12:13.423?