android - Retrieve SQLite Data by using Date part out of DateTime Format -
i want retrieve date sqlite using date. default column in sqlite inserted datetime format.
for instance,this type table
_id date_value
1 2015-07-06t11:36:35
2 2015-07-06t12:10:10
3 2015-07-06t12:10:19
4 2015-07-03t17:13:59
5 2015-07-03t17:14:04
6 2015-07-03t17:14:27
i want retrieve data using date only. how want query?
i tried retrieve this: select * type date_value=date('2015-07-03t17:13:59') returns 0 rows.
i need rows date(2015-07-03) matched
expected result: _id date_value
4 2015-07-03t17:14:27
5 2015-07-03t17:14:04
6 2015-07-03t17:14:27
how should achieve output?
the date()
function returns date part of parameter, result of date('2015-07-03t17:13:59')
'2015-07-03'
. value not match of values in date_value
column.
you need extract date values in date_value
column:
select * type date(date_value) = '2015-07-03'
Comments
Post a Comment