samedi 2 avril 2016

How to write query to select all rows between now and last 1 day in sqlite?

I know this question might be a duplicate one but I couldn't find any suitable answer. My query I'm tryign is the following

SELECT *
  FROM MY_TABLE
  WHERE MY_DATE_COLUMN between datetime('now', '-start of days')
    AND datetime('now', 'localtime')

and then I added a record 10 mins ago and retrieved it. But 0 rows returned. If my query is wrong, could you please help me fix it?

Aucun commentaire:

Enregistrer un commentaire