Skip to content
Advertisement

SQLite database – select the data between two dates?

I want to select my data by date – from a date until another date, so I have this query,

But this query only return the data in '2014-10-09', excluding the data in '2014-10-10', unless I change the query to this below,

This is not an ideal solution. How can I select the data including the data in '2014-10-10'?

NOTE:

I think my problem is different from other duplicate questions becos,

  1. My date type is TEXT.
  2. I need to select the date’s data without its time.
  3. It is an SQLite database.

My sample data:

Advertisement

Answer

You could also just not use between.

Example:

Since it includes time, and you dont want the time. this:

question updated again, additional answer

Ugh. you have timestamp fields? in that case this:

finally we have arrived at sqlite

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement