日期比较Sqlite Android

时间:2013-05-07 17:33:53

标签: android sql sqlite

如何使用SQlite对日期进行比较,我尝试了更多失败。帮助:D 我的查询:

SELECT 
        latitude, 
        longitude, 
        grupo_crime_id_grupo_crime, 
        descricao, 
        id_crime, 
        cities_id_cities, 
        time, 
        estado 
FROM crime WHERE 
        cities_id_cities='0' AND 
        time >= datetime('2013-03-28T09:30:37-03:00') 
        time <= datetime('2013-0328T09:30:37-03:00') AND 
        grupo_crime_id_grupo_crime='1'

1 个答案:

答案 0 :(得分:4)

像这样使用:

select * from MyTable 
where mydate >= Datetime('2000-01-01 00:00:00') 
and mydate <= Datetime('2050-01-01 23:00:59')