i am trying to select some accounts depending on the updating time..
My Table named as account and has columns like createdOn , updatedOn, acountName etc.
Now the date is being stored as string 2012-03-20
How can i make sql query to select diff accounts depending on date.
Here is my code
public ArrayList<Account> getAllAccountsForReports(Date dateTo, Date dateFrom)
{
ArrayList<Account> accounts = new ArrayList<Account>();
String queryString = "SELECT * FROM MAAccounts WHERE updatedOn = ? BETWEEN updatedOn = ? ORDER BY accountType, accountName";
Cursor result = mDb.rawQuery(queryString, new String[]{ dateToDB(dateTo), dateToDB(dateFrom)});
Please tell me how can i correct my sql query.
Best Regards