Have this line of code in the getEvents method of my DBHelper.
int year, month, day;
String[] columns = new String[] { KEY_EVENTNAME, KEY_DESCRIPTION,
KEY_HOUR, KEY_MINUTE, KEY_DAY, KEY_MONTH, KEY_YEAR,
KEY_REMINDER };
Cursor c = database.query(DATABASE_TABLE, columns,
KEY_YEAR + "=?"+ " AND " + KEY_MONTH + "=?" + " AND "+ KEY_DAY + "=?",
new String[] {String.valueOf(year), String.valueOf(month), String.valueOf(day)},
null, null, KEY_MONTH + " AND "
+ KEY_DAY);
It always returns nothing. When I remove the following
int year, month, day;
String[] columns = new String[] { KEY_EVENTNAME, KEY_DESCRIPTION,
KEY_HOUR, KEY_MINUTE, KEY_DAY, KEY_MONTH, KEY_YEAR,
KEY_REMINDER };
Cursor c = database.query(DATABASE_TABLE, columns,
KEY_YEAR + "=?",
new String[] {String.valueOf(year)},
null, null, KEY_MONTH + " AND "
+ KEY_DAY);
it runs correctly. What's the problem with my code? It seems like it doesn't accept multiple values as where clause. Can any one help me with this? Thanks.