i have sqlite database contain 5 columns id,category,account,amount,date. i want to retrive data into piechart. i use the following code to get expenses category and total amount during certain date to piechart .i want to filter these retrieved data by account .
please help me what modification should done to the code
public Cursor getdata(SQLiteDatabase db, String table, String from, String to) {
String query = " select e_category,sum(e_amt) from " + table + " where e_date between '" + from + "'and '" + to + "'" + " group by e_category ";
Cursor res = db.rawQuery(query, null);
return res;
}
Aucun commentaire:
Enregistrer un commentaire