Search code examples
androidmysqlsqlitestrftime

Using strftime in SQLite


My date stored in DB like this:

date in long

I need only month higher than 9

date strftime

But query still work with the old (before "strftime" command) long numbers.

What is the best way to solve this problem?


Solution

  • strftime always returns a string, and strings are considered larger than any number.

    To get the correct result, use a string comparison:

    ... WHERE strftime(...) > '09'