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
You need to do one of these two options:
between condition: ... where created_at between '2013-05-01 00:00:00' and '2013-05-01 23:59:59' (not recommended... see the last paragraph)between. Notice that then you'll have to add one day to the second value: ... where (created_at >= '2013-05-01' and created_at < '2013-05-02')My personal preference is the second option. Also, Aaron Bertrand has a very clear explanation on why it should be used.