I'm trying to select a specific date between two dates. The forma its stored in the DB is M/d/yyyy
. What I'm trying to do, is passing two dates, and I want to select all data of a column between this two dates. I know there is data in the DB, but it doesnt bring anything for some dates.For some dates, it brings the data, but for some dates it brings the data.
Example:
When I choose 7/10/2011 as first date, and as second date 7/16/2011, it brings the data. But When I choose 7/9/2011 as first date and as second date 7/16/2011, it doesnt bring anything.
Here is my query:
Cursor cursor = db.query(CONTACT_DATA, new String[] { "duration" },
"date >= ? AND date <= ?",
new String[] { firstDate, secondDate }, null, null, null);
If anyone can help with this question. Thanks!