我使用了这种查询语法
String query = "SELECT * FROM transactions T, expenses E"
+ " WHERE T.trid = E.trid AND T.date between \'"
+ Utils.getFormatedDate(from) + "\' and \'"
+ Utils.getFormatedDate(to) + "\'";
Log.d("from and to ", "\'" + Utils.getFormatedDate(from) + "\' and \'"
+ Utils.getFormatedDate(to) + "\'");
Cursor cursor = db.rawQuery(query, null);
注意:Utils.getFormatedDate(date)
返回一个字符串,如:“2014-05-08”。
但它不起作用! 有什么帮助吗?