I have to get all records count from table. My Approach is as follows:
public int getTasksByStatusIDBetweenDates(int statusID, String startDate, String endDate) {
SQLiteDatabase db = this.getReadableDatabase();
Cursor cursor = db.rawQuery(
"select * from Task" +
" where StatusID=" + statusID + " and AssignDate between '" + startDate + "' and '" + endDate + "'", null);
int total = 0;
if (cursor.moveToFirst())
total = cursor.getInt(0);
cursor.close();
return total;
}
Currently it is returning me 0. My date format is "yyyy-MM-dd HH:mm:ss"
Please guide me where i am doing wrong. Thanks !