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 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 to give "true" as the result even with midnight wrap around? _______________________________________________ sqlite-users mailing list sqlite-users at mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users