0
我试图在月内获取所有记录。SQLite Android - geting月
我的日期存储为文本(tryed日期),并在一个字符串的Android
我对获得当前日期方法:
private String getDateTime() {
SimpleDateFormat dateFormat = new SimpleDateFormat(
"yyyy-MM-dd HH:mm:ss", Locale.getDefault());
Date date = new Date();
return dateFormat.format(date);
}
和我的光标:
public Cursor getCursor(){
return db.rawQuery("Select strftime('%m', " + CN_DATE + ") as valMonth from " + TABLE_NAME + " where valMonth = '05' GROUP BY valMonth)" , null);
}
错误:接近“)”:语法错误(代码1):,编译时:选择...
thx在您的帮助推进:)
(对不起,我的英语)
thx for ur answer!但现在它说:列'_id'不存在 有一种方法可以将查询的结果存储在一个变量中?用于另一个查询? –
抛出的异常究竟在哪里?你在使用'CursorAdapter'吗? – laalto
是的,我使用CursorAdapter来填充自定义列表视图 –