Tuesday, 27 August 2013

Android query for sqlite with date

Android query for sqlite with date

I don't understand why my query does not work in Java (android). I would
like access to a sqlite databse but I think the problem is about the
"WHERE" clause.
Cursor cQuery = db.query("PLUGBATTERY", new String[] {
"strftime('%s',date)", "code", "state","startup"
},
"strftime('%Y-%m-%d',date)=="+DATE_FORMAT_DATE.format(currentC.getTime()),
null, null,null, "strftime('%s',date)");
in the debug view I have DATE_FORMAT_DATE.format(currentC.getTime()) =
2013-08-22
Maybe I can test my query out of my application code but I don't know how
to do that...
Thanks for your help.

No comments:

Post a Comment