Reputation: 247
I used a code similar to the following code to search the database between two dates :
cursor.query(select column from Table where columnDate between '2018-09-20' and '2018-09-23');
But now I want to use query projection
,selection
and selcetionArgs
.
How can I update my code?
Upvotes: 0
Views: 150
Reputation: 1167
you can use this:
cursor.query("Table" ,
new String[]{"column"},
"columnDate BETWEEN ? AND ?",
new String[]{"2018-09-20","2018-09-23"},
null/*Group by if you need*/,
null/*having if you need*/,
null/*order by if you need*/);
Upvotes: 1