android - How to put a query using cursor loader? -
this sqlite query , need use in cursor loader. select * triphistory _startdate > date('now','-8 days');
i try not working code given below . please check this.
c = new cursorloader( this, hollacontractclass.hollas.trip_history_uri, projection, hollacontractclass.hollas.hollatriphistorycolumns.status + " =? , " + hollacontractclass.hollas.hollatriphistorycolumns.start_date + " >?", new string[] { "finished", "date('now','-8 days')" }, hollacontractclass.hollas.hollatriphistorycolumns.start_date + " asc");
but return 0 .. in advance
sql parameters (?
) strings not interpreted in way.
the values in start date column compared against literal string date('now','-8 days')
.
to execute date
function, have write directly sql string:
c = new cursorloader( ... + hollacontractclass.hollas.hollatriphistorycolumns.start_date + " > date('now','-8 days')", new string[] { "finished", },
Comments
Post a Comment