I’m trying to select data from an SQLite database where all of the content was published on one date regardless of the year it was published in. For example: every July 15th listed in the database.
This is my code so far.
SELECT Date, Content FROM MYDATABASE WHERE Date = date('now')
How can I make it so that all previous entries on the current date are also included?
You can compare the month-day parts which you obtain with the
strftime(...)function:See the documentation for more about the date time functions: http://www.sqlite.org/lang_datefunc.html
Please be aware that for the date and time functions to work properly, your dates must be stored in one of the following formats (as mentioned in the docs linked above):