I have a situation where I want to receive data up to two days ago and until the end of today. I came to the next.
WHERE dateTimeRecorded between date('now', 'start of day','-2 days') and date('now', 'start of day', '+1 day')
Well, technically, I will also be at midnight tomorrow, like the original poster, if there were any data, but my data is all historical.
The key thing to keep in mind is the original poster deleted all data after 2009-11-15 00:00:00. Thus, any data recorded at midnight on the 15th was included , but there was no data after midnight on the 15th. If their request was,
select * from table_1 where mydate between Datetime('2009-11-13 00:00:00') and Datetime('2009-11-15 23:59:59')
Use of clarification for clarity.
It would be a little better. It still doesnβt take into account seconds of a jump in which an hour can have more than 60 seconds, but is good enough for discussion here :)
Lyall Pearce Nov 23 '17 at 7:40 2017-11-23 07:40
source share