Skip to content Skip to sidebar Skip to footer

How Can I Fetch The Data Of Specific Month From Sqlite Database

I saved my data In SQLite Database. I saved my date in database as DATETIME datatype. I want to retrive only the data of specific month from my SQLite databse. I try the below quer

Solution 1:

This is probably not optimal, but you could use:

select column_name from table_name wherestrftime('%Y-%m', column_name) = '2011-05';

Solution 2:

Use a function retrieve only the month of the date

SELECT strftime('%m', date(column_name)) FROMtable;

I believe this is the function, but I'm not so sure.

Post a Comment for "How Can I Fetch The Data Of Specific Month From Sqlite Database"