sql - Android SQLite not selecting date -


i have sqlite database in app stores date in format of yyyy-mm-dd hh:mm:ss

i love query transaction happend on month of of year code not working don't know why. query shown below, please advice.

select count(id_sale) total_transactions,sold_to,  strftime('%m', sale_date) month,  strftime('%y', sale_date) year, sale_date sales   month=5 , year=2015 

after research discovered reason had casting work. here answer below. down vote anyway.

    select count(id_sale) total_transactions,sold_to, cast(strftime('%m', sale_date) integer) month,      cast(strftime('%y', sale_date) integer) year,     sale_date sales   month=5 

Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -