2013-05-07 95 views
1

如何在使用SQlite的日期之間進行比較,我試過這個更失敗。幫助:d 我的查詢:日期比較Sqlite Android

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' 

回答

4

使用這樣的:

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

工作,只是需要做轉換日期! – 2013-05-07 18:06:57