java - How to delete rows from sqlite table for a given date range using string value? -
i pass date values fetch matching rows fall between dates (fd=from date , td=to date)and string txid
deletion table. unable use 'between' , 'and' clause here 'where' clause.
how use these clauses in whereargs
correctly fetch rows deletion?
public int deleteallexpensestxrowforselectperiod(string fd,string td){ sqlitedatabase db=helper.getwritabledatabase(); string txid="e"; string[] whereargs={txid}; int countdb=db.delete(vivzhelper.tx_table, vivzhelper.tx_id + " =?", whereargs); return countdb; }
first think missing space between = , ?.
then, can write argument use dates.
string[] whereargs={txid, fd, td}; int countdb=db.delete(vivzhelper.tx_table, vivzhelper.tx_id + " = ? , date < ? , date > ?", whereargs);
Comments
Post a Comment