On Thursday 08 March 2001 18:49, you wrote:
> Anyone know offhand a way to organize the output from a query by week? 
> I'm writing a work log app and I want the admin to see everyone's work
> ordered first by lastname, and then by date.  But only want that week's
> data to show up, and maybe a dropdown with previous weeks available. 
> Don't go thinking about an answer, cuz I'm doing that, but if anyone
> already knows how to solve this problem or part of it, lemme know. 
> Thanks once again.

for MySQL add a WHERE (WEEK(yourtimefield) = WEEK(NOW()))

this will have the problem that it will show all of week X even if you're 
on 23:55 on the last day of that week

WHERE ((yourtimefield >= NOW()) AND (yourtimefield <= DATE_ADD(NOW(), 
INTERVAL 1 WEEK))

might be better

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

...10001000110101011010101101011110111010113...????

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to