Ok I should know this after 20+ years of coding and querying databases, but it still doesn't make sense to me.
If I do this:
SELECT * FROM sometable WHERE createdate >= '5/1/2018' and createdate <= '5/1/2018'
I get:
6500061 2018-05-01 00:00:00
6500642 2018-05-01 00:00:00
6505091 2018-05-01 00:00:00
6505453 2018-05-01 00:00:00
6505469 2018-05-01 00:00:00
6505506 2018-05-01 00:00:00
But if I do this:
SELECT * FROM sometable WHERE createdate >= '5/1/2018 00:00:00' and createdate <= '5/1/2018 23:59:59'
I get:
6500061 2018-05-01 00:00:00
6500642 2018-05-01 00:00:00
6500652 2018-05-01 11:08:00
6500726 2018-05-01 11:25:00
6500736 2018-05-01 11:27:00
6504776 2018-05-01 15:05:00
6504778 2018-05-01 15:06:00
6505091 2018-05-01 00:00:00
6505371 2018-05-01 17:42:00
6505453 2018-05-01 00:00:00
6505469 2018-05-01 00:00:00
6505506 2018-05-01 00:00:00
6507371 2018-05-02 00:00:00
6508695 2018-05-02 00:00:00
Why doesn't SQL return everything that has that date no matter what the time is? Is there another function that I should be putting around my dates so I don't have to put the times in and just look at the dates?