SQLite Forum

datetime problerm
Login
SQLite does not have a separate "DATE" datatype that does magic comparisons
of dates and times.  It has only strings, floating point numbers, and integers.

You are apparently storing your dates a strings.  The ">=" operator in your
WHERE clause is doing a string comparison.

If you want to compare dates in chronological order,
you can do that in one of several ways:

  *  Store the dates as a floating-point number that is the julian day number.

  *  Store the dates as an integer number of seconds since 1970.

  *  Store the dates as strings in the ISO-8601 date/time format (YYYY-MM-DD HH:MM:SS)
     which has the useful property that lexicographical order and
     chronological order are the same.

  *  Write your own custom collating sequence that compares mixed-endian
     dates (such as your DD/MM/YYYY HH:MM:SS format) in the correct order.

SQLite has built-in support for the first three options.  But for the fourth
option, you'll need to write your own code.