I am trying to get this week's data in sqlite but it seems that I have missed something as i get wrong information back. To be more specific i want to retrieve all the data in my database that have a timestamp which its date falls in this week. This week may either start from Sunday or Monday i.e 26/2/12-03/03/12. At the moment I am using something like this: SELECT * FROM myTable WHERE DATE(timeStamp) == DATE('now', 'weekday 0', '-7 days')
I think you should be pretty close. If you want everything since the start of this week, just a slight modification:
SELECT * FROM myTable WHERE DATE(timeStamp) >= DATE('now', 'weekday 0', '-7 days');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With