Re: DATE_SUB Issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



still no luck - any other suggestions?
__________________________________
Craig Hoffman - eClimb Media

v: (847) 644 - 8914
f: (847) 866 - 1946
e: choffman@xxxxxxxxxx
w: www.eclimb.net
_________________________________
On Mar 29, 2004, at 8:18 AM, John W. Holmes wrote:

From: "Craig Hoffman" <choffman@xxxxxxxxxxx>

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 week 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

If time_upload is a column, it should not be between single quotes in the
WEEK() function.


---John Holmes...

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux