Reputation: 17293
I was using Microsoft's Jet database engine before. And, say, if I needed to select entries for a specific month I do this:
SELECT * FROM `table name` WHERE MONTH(`date column`)=4
But how do you do the same with SQLite?
Upvotes: 18
Views: 33049
Reputation: 385647
How about
SELECT * FROM table_name WHERE strftime('%m', date_column) = '04'
Upvotes: 50
Reputation: 47978
SELECT * FROM `table name` WHERE strftime('%m', `date column`) = '04'
Upvotes: 13