我想从表中按日期获取数据

问题描述 投票:-2回答:1

我想从表中按日期获取数据。

这是表格结构;

 String TABLE_VISIT_DETAILS = "CREATE TABLE IF NOT EXISTS "+DBContract.TABLE_VISIT_DETAILS+"("
                +DBContract.VISIT_DETAILS_ID+" INTEGER PRIMARY KEY AUTOINCREMENT,"
                +DBContract.VISIT_DETAILS_VISITOR_USER_ID+" INTEGER,"
                +DBContract.VISIT_DETAILS_MEET_TO+" TEXT,"
                +DBContract.VISIT_DETAILS_VISIT_DATE+" TEXT,"
                +DBContract.VISIT_DETAILS_ENTRY_TIME +" TEXT,"
                +DBContract.VISIT_DETAILS_EXIT_DATE_TIME +" TEXT,"
                +DBContract.VISIT_DETAILS_PURPOSE +" TEXT,"
                +DBContract.VISIT_DETAILS_STATUS +" TEXT,"
                +DBContract.VISIT_DETAILS_ITEM_CARRIED +" TEXT"+
                ")";
sqlite android-sqlite
1个回答
0
投票

使用此查询可在两个日期(时间戳)之间获取数据。

@Query(“SELECT * FROM TABLE_VISIT_DETAILS WHERE date BETWEEN:date1 AND:date2”)列表getDataBetweenInterval(long date1,long date2);

© www.soinside.com 2019 - 2024. All rights reserved.