I have a question.
Have a table like this:
(table name: times)
+-------+-----------+---------+
| block | startTime | endTime |
+-------+-----------+---------+
| 1 | 08:00 | 10:00 |
+-------+-----------+---------+
when I use rawquery like this:
String ctime = "'09:45'";
cursor = sdb.rawQuery(String.format("select block from times where startTime < time(%s) and endTime> time(%s)", ctime,ctime), null);
I Can get the correct data "1".
But when I use query like this:
cursor = sdb.query("times", new String[]{"block"}, "startTime <= time(?) and EndTime >= time(?)", new String[]{ctime,ctime}, null, null, null);
I can't get the correct data. The Cursor count is 0.
Why??
%s.HH:MMis a valid time string in SQLite - sqlite.org/lang_datefunc.html