Sqlite查詢時間段內的資料問題解決!

2021-06-05 17:50:43 字數 674 閱讀 7446

最近搞sqlite本地查詢,需求為查詢某時間段內的資料,在sql中我們都知道為:

select * from tblname where rdate between '2008-6-10' and  '2008-6-12'
這樣子是沒有問題的,但是在sqlite中我們這樣子寫是得不到結果的,試了好多次終於發現在規律,我們寫成如下:

select * from tblname where rdate between '2008-06-10' and  '2008-06-12'
******dateformat sdf=new ******dateformat("yyyy-mm-dd");

cur_calender.set(year, month, day);

switch (sel_date_type)

break;

case 2://結束時間

if(search_date_end!=null)

break;

default:

break;

}}

現在就ok了!

mysql查詢時間段內資料

今天 select from 表名 where to days 時間欄位名 to days now 昨天select from 表名 where to days now to days 時間欄位名 1 近7天select from 表名 where date sub curdate interval...

mysql查詢時間段內資料

今天 select from 表名稱 where to days 建立時間 字段 to days now 昨天 select from 表名稱 where to days now to days 建立時間 字段 1 近七天 select from 表名稱 where date sub curdate...

mysql查詢時間段內資料

mysql查詢時間段內資料 先來 mysql查詢時間段內資料 後到 mysql查詢時間段內資料 1 建表語句 set foreign key checks 0 table structure for t user drop table if exists t user create table t ...