How can I display records by week from a table. I have an 'orders' table and would like to total the orders entered by week like so.... 5/8/2005-5/14/2005 143 5/15/2005-5/22/2005 155
Can this be done within the query or would some php be needed.
You didn't meantion which database you're using. I'll assume MySQL. Check out: http://dev.mysql.com/doc/mysql/en/date-and-time-functions.html
In there is DATE_FORMAT(). Use that in your group by clause but set it for week. You may need to fiddle a little bit with your SELECT clause to have it make sense of which week it is (for starting out, you may just toss your DATE_FORMAT() in the select clause and see what kind of output you get).