this is somewhat related, but not the answer to your problem - sometimes when I want to do a query broken down by days on my orders table, I do a to_days() on the orderDate (datetime type) to select out the order for that day.
I believe to_days() works for timestamp types also.
So, this means you can do something like: select * from orders where orderDate between to_days("2001-01-01") and to_days("2001-01-31")