SQLLite query datatime divided into week of the year, and month of the year
I made it

SELECT 
  strftime('%Y-%m',star_time) AS date
  , Sum(distance) 
FROM activity 
WHERE 
Group By 
  strftime('%Y-%m',start_time)