For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > March 2004 > DATE_SUB Issues









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author DATE_SUB Issues
Craig Hoffman

2004-03-29, 10:32 am

Hi There,
Perhaps someone could lend me a hand here on this query. I have a
query where I would like it to SUM up the last 7 days of records
further, It needs to start a new w on Monday. The 'time_upload'
field is a datetime field. What am I doing wrong or not doing here ?

SELECT SUM(distance), DATE_FORMAT('time_upload', '%u'),
WEEK('time_upload', '7') FROM TRAININGLOG WHERE DATE_SUB(NOW(),INTERVAL
7 DAY )
< =time_upload

Thanks,
Craig H.
__________________________________
Craig Hoffman - eClimb Media

v: (847) 644 - 8914
f: (847) 866 - 1946
e: choffman@eclimb.net
w: www.eclimb.net
_________________________________
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com