I have a DATETIME field. I would like to select all the records that have been updated in the last week. Right now I'm using this query:
SELECT SUM(mins_spent) as time_sum FROM todos WHERE
lastUpdate >= '2008-12-22' AND lastUpdate <='2008-12-28'
But the results i get seem to be different depending on time of the day, e.g on 7 PM I might get 17 hours and on 11 PM I'l get 14 hours even though it should be increasing, not decreasing. I was thinking of changing the query to:
SELECT SUM(mins_spent) as time_sum FROM todos WHERE
lastUpdate >= '2008-12-22 00:00:00' AND lastUpdate <='2008-12-28 00:00:00'
Would it help at all? Suggestions please..