SQLite - Select Date for a specific month - Extract month from a date to check that in a where clause

Revision as of 15:05, 6 October 2019 by Ardaut (talk | changes)

Use strftime() - Here as an example all dates with the month July (number 7) are selected.

SELECT * FROM tablename WHERE strftime('%m', date_column) = '07'

If you want to extract the Month for the current date, then use the following SQL query:

SELECT strftime('%m','now')

More about strftime()