I’m working on an android project which retrieves information from a database and stores it (using SqLite for Java side).
Here is my request:
String Query =
"SELECT xxx.APP_ID " + "FROM xxx INNER JOIN yyy ON
xxx.APP_ID = yyy.APP_ID " +
"WHERE date('"+mydate+"') BETWEEN date(xxx.APP_DATEBEGIN) AND date(xxx.APP_DATEEND)
" +
"AND (yyy.USR_ID = " + myid + ") " +
"ORDER BY xxx.APP_DATEBEGIN";
mydate format is : YYYY-MM-DD HH:MM:SS which is the same format with the date in the database.
I execute the same request (Sql server side) with convert which works fine. I think that the keyword date is not available in SqLite.
Is there a another way to do this?
In SQLite, you do not need to use any function to represent date – just use plain string that contains date: SQLFiddle demo.
This is in agreement with documentation: