public Cursor queryDetail(String date) {
SQLiteDatabase db = getWritableDatabase();
String strSql ="select a.rowid, money,b.typename,note,b.rowid from account_bill a "+
"inner join account_type b "+
"on a.typeid = b.rowid where date = *"+date+"* order by a.rowid desc";
Cursor c = db.rawQuery(strSql, null);
return c;
}
public Cursor queryTotal(String beginDate,String strEndDate,String strTypeId) {
SQLiteDatabase db = getWritableDatabase();
String strSql="select a.typeid,totalmoney,b.typename from "+
" (select typeid,sum(money) as totalmoney from account_bill where date between *"+beginDate+"* and *"+strEndDate+"*"+
" group by typeid) a"+
" inner join account_type b"+
" on a.[typeid] =b.rowid where ("+strTypeId+"=-1 or b.rowid="+strTypeId+")";
Cursor c = db.rawQuery(strSql, null);
return c;
}
SQLiteDatabase db = getWritableDatabase();
String strSql ="select a.rowid, money,b.typename,note,b.rowid from account_bill a "+
"inner join account_type b "+
"on a.typeid = b.rowid where date = *"+date+"* order by a.rowid desc";
Cursor c = db.rawQuery(strSql, null);
return c;
}
public Cursor queryTotal(String beginDate,String strEndDate,String strTypeId) {
SQLiteDatabase db = getWritableDatabase();
String strSql="select a.typeid,totalmoney,b.typename from "+
" (select typeid,sum(money) as totalmoney from account_bill where date between *"+beginDate+"* and *"+strEndDate+"*"+
" group by typeid) a"+
" inner join account_type b"+
" on a.[typeid] =b.rowid where ("+strTypeId+"=-1 or b.rowid="+strTypeId+")";
Cursor c = db.rawQuery(strSql, null);
return c;
}


