mardi 22 mars 2016

SQLite Query delete in andoid

i want to execute a query to like this....

delete FROM employees where hired_on >= date('now', 'start of day', '-30 days');

It tired to execute

String dateLimit = "date('now', 'start of day', '-30 days')";

database.delete(TABLE_NAME,COLUMN_NAME + " >= ? ", new String[]{dateLimit});

database.execSQL("DELETE FROM " + TABLE_NAME + " WHERE " + COLUMN_NAME  + " >= " + dateLimit);

but didn't worked....

what should i have to do?

thanks in advance......

Aucun commentaire:

Enregistrer un commentaire