如何从sqlite中选择一段日期 [英] How select a period of date from sqlite

查看:70
本文介绍了如何从sqlite中选择一段日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 SQLite 中有一个表,它包含三个字段(id、fromDate、toDate、uid).我想选择在特定日期创建的行.用户选择时间段(从日期/到日期).如何使用 ORMLite 进行查询?

I have a table in SQLite that has three fields (id, fromDate, toDate, uid). I want to select rows that has created in a specific dates. User select the period of time (from date/ to date). How I can query with ORMLite?

推荐答案

Sqlite 没有日期类型(supported类型)有一些 dateTime 函数,我认为任何函数都可以满足您的要求......更简单的解决方案将您的日期转换为时间戳并比较时间戳.

Sqlite does not have a Date type(supported types) There is some dateTime functions, i think that any of function will meet your requirement... The easier solution will be to convert you date to a timestamp and compare the timestamp.

这篇关于如何从sqlite中选择一段日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆