gpt4 book ai didi

java - 如何根据当前日期筛选记录?

转载 作者:搜寻专家 更新时间:2023-11-01 09:19:02 25 4
gpt4 key购买 nike

我正在实现一个功能,我以字符串形式存储日期并使用 LocalDate 函数获取字符串中的当前日期,因此我想比较两个日期,我只想获取当前日期记录。

没有发现错误,但无法获取记录。

  public ArrayList<Followup_Model> followup_reminder (ArrayList<Followup_Model> followup_Model_list) {
if (followup_Model_list == null) {
followup_Model_list = new ArrayList<>();
}
SQLiteDatabase sqLiteDatabase = this.getReadableDatabase();
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy/MM/dd");
LocalDate localDate = LocalDate.now();
String Today = dtf.format(localDate);
Cursor followup_output = sqLiteDatabase.rawQuery("SELECT * FROM " + Table_Name_Followup +
" WHERE CREATEDBY = '1' AND CHECKED = '1' AND STARTDATE = " + Today +
" ORDER BY REMINDER ASC",null);

最佳答案

只需复制和粘贴。

public ArrayList<Followup_Model> followup_reminder (ArrayList<Followup_Model> 
followup_Model_list) {
if (followup_Model_list == null) {
followup_Model_list = new ArrayList<>();
}
SQLiteDatabase sqLiteDatabase = this.getReadableDatabase();
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy/MM/dd");
LocalDate localDate = LocalDate.now();
String Today = dtf.format(localDate);
Cursor followup_output = sqLiteDatabase.rawQuery("SELECT * FROM " + Table_Name_Followup +
" WHERE CREATEDBY = '1' AND CHECKED = '1' AND STARTDATE = '" + Today + "'" +
" ORDER BY REMINDER ASC",null);

关于java - 如何根据当前日期筛选记录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58299075/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com