回答
首先在其中存儲日期欄應該是一個長型。該列將存儲日期的紀元毫秒數。
現在對於查詢
Calendar calendar = Calendar.getInstance(); // This will give you the current time.
// Removing the timestamp from current time to point to todays date
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
calendar.add(Calendar.DATE, -3); // Will subtract 3 days from today.
Date beforeThreeDays = calendar.getTime();
calendar.add(Calendar.DATE, 6); // Will be your 3 days after today
Date afterThreeDays = calendar.getTime();
db.query("Table", null, "YOUR_DATE_COLUMN >= ? AND YOUR_DATE_COLUMN <= ?", new String[] { beforeThreeDays.getTime() + "", afterThreeDays.getTime() + "" }, null, null, null);
Select *
From TABLE_NAME
WHERE DATEDIFF(day, GETDATE(), COLUMN_TABLE) <= 3
試試這個,讓我知道這是否解決了問題 –
光標C = SDB \t \t \t \t .rawQuery( \t \t \t \t \t \t「選擇Reminder_Id,Reminder_Type, Reminder_Date,Reminder_Time,Reminder_Alert from「im試試這個爲當前日期如何實現在這個 \t \t \t \t \t \t \t \t + Reminder_Main \t \t \t \t \t \t \t \t + 「其中」 \t \t \t \t \t \t \t \t + Car_ID \t \t \t \t \t \t \t \t +「=? AND「+ Reminder_Date +」=? 」 \t \t \t \t \t \t新的String [] {summaryid,currentdate1}); – pitambar
- 1. 從SQLite數據庫中檢索數據
- 2. 從sqlite數據庫檢索數據?
- 3. Android ::檢索數據從SQLite數據庫
- 4. RuntimeException從SQLite數據庫檢索數據
- 5. 從SQLite數據庫檢索數據
- 6. 無法從SQLite中檢索數據
- 7. 從sqlite中檢索所有數據
- 8. 從SQlite數據庫檢索整數值
- 9. 如何從sqlite檢索數據Android
- 10. 從sqlite檢索數據由周
- 11. Android從SQLite數據庫檢索值
- 12. 無法從SQLite數據庫檢索值
- 13. 從sqlite查詢檢索數據Node.js
- 14. 從sqlite數據庫每月檢索值
- 15. 從光標檢索SQLite查詢數據
- 16. 檢索數據從sqlite與c
- 17. android sqlite從數據庫檢索值?
- 18. 從SQLite數據庫檢索BLOB android
- 19. 如何從SQLite數據庫檢索值
- 20. 從數據庫sqlite檢索值
- 21. 檢索sqlite的數據,iPhone
- 22. Sqlite數據檢索問題
- 23. SQLITE檢索數據錯誤
- 24. 遊標沒有從sqlite數據庫中檢索數據
- 25. 從exisint sqlite數據庫中檢索數據
- 26. 從SQLite數據庫檢索數據到ListView中
- 27. 從SQLite數據庫的列表視圖中檢索數據
- 28. 從sqlite數據庫中檢索數據時出現NullPointerException
- 29. 從SQLite數據庫中檢索數據時出現錯誤
- 30. 如何從sqlite數據庫中檢索數據
謝謝@vivek我會嘗試這一點,與將讓你知道這個 – pitambar
其工作鰭片 – pitambar