Reputation: 117
I want to delete elements at today's date. But this statement doesn't work.
cur.execute("DELTE FROM medicine WHERE date DATE('now') AND DATE('now', '-1 day')")
try:
tree.delete(cur)
except IndexError:
pass
Upvotes: 1
Views: 52
Reputation: 164139
If the column's date
format is YYYY-MM-DD
then you need this statement:
DELETE FROM medicine WHERE date = DATE('now')
or:
DELETE FROM medicine WHERE date = CURRENT_DATE
Upvotes: 1