[sqlite] Time & between, midnight wrap around

2016-05-15 Thread Scott Robison
Off the top of my head: Select case when t1 < t2 then t3 between t1 and t2 when t1 > t2 then t3 >= t1 or t3 <= t2 end You might need to tweak it to handle the case when t1 = t2 if needed. Could mean one minute or could mean 24 hours depending on your pov. Hello, BETWEEN doesn't give the result I

[sqlite] Time & between, midnight wrap around

2016-05-14 Thread R Smith
On 2016/05/14 8:28 PM, Daniel Polski wrote: > Hello, > BETWEEN doesn't give the result I would need when used with time > before & after midnight: > > SELECT time('23:00') BETWEEN time('22:00') AND time ('23:30'); > time > > 1 > > sqlite> SELECT time('23:00') BETWEEN time('22:00') AND time

[sqlite] Time & between, midnight wrap around

2016-05-14 Thread Daniel Polski
Hello, BETWEEN doesn't give the result I would need when used with time before & after midnight: SELECT time('23:00') BETWEEN time('22:00') AND time ('23:30'); time 1 sqlite> SELECT time('23:00') BETWEEN time('22:00') AND time ('01:00'); time 0 Any suggestion how to tweak the query