android - get week number of a date -


select strftime('%w', day) week, sum(amount) mytable group week order week desc 

this query useful amount week. 1 gives week number in year, may know how week number in month. have googled lot. results related week number in year not in month.

thanks in advance.

you can manipulate strftime() answer.

apply strftime() on given date , first date of given dates month , subtract them week number of month

eg

 select  strftime('%w','2013-05-04')-strftime('%w','2013-05-01') +1; 

sql fiddle demo


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -