I have a problem in displaying the data in my application for each week?
I can show the data by day using this code in my SQLite
SELECT substr(_id, 1, 7) as _id, sum(value) as total FROM pd_table GROUP BY _id order by _id desc

I was also able to display the data based on the month by using this code
SELECT substr(_id, 1, 10) as _id, sum(value) as total FROM pd_table GROUP BY _id order by _id desc

_id using SimpleDateFormat (“yyyy-MM-dd HH: mm: ss”)
now i want to display it every week. How?
Any answer is very useful for me 🙂
SQLite has internal date/time formatting function strftime, and one of possible format option is a week number. So your query should look like this:
Though I didn’t try it on Android. See more here: http://sqlite.org/lang_datefunc.html