I have a query which selects data for that are a week old as follows.
SELECT * FROM Table WHERE datetime(Time,'unixepoch','localtime') >= date('2015-09-07', '-7 day');
Instead of selecting one week old data, I want to select for the current week(ie, if Today is Thursday, then I want the data to be selected for Sunday, Monday, Tuesday, Wednesday, Thursday of the current week)
Week goes from Sunday to Saturday.
How can I modify the above query to get the current week data.
Similarly, how can I do this for current month? For month, I am doing this now:
SELECT * FROM Table WHERE datetime(Time,'unixepoch','localtime') >= date('2015-09-07', '-1 month') ;
Which gives all data a month old. But, I want to select for this month( if today's the sep 7th, get all data for sep 1st to 7th)