Hi Folks,
I'm trying to create a counter for my website. I'm
trying to pull the last 7 days worth of data out of
mysql. My sql statement is as follows.
SELECT TheDate, Count(TheDate) AS CountOfdate
FROM Counter
WHERE (((TheDate)<Now()) AND ((TheDate)>=Now()-7))
GROUP BY TheDate;
When I do this Sql Commmand it returns 0 records.
Can someone help me with this statement.
Thank you -- Mike
This is my data.
+---------------+----+------------+
| Host | ID | TheDate |
+---------------+----+------------+
| 192.168.0.140 | 1 | 2001-07-23 |
| 192.168.0.140 | 2 | 2001-07-23 |
| 192.168.0.140 | 3 | 2001-07-20 |
| 192.168.0.140 | 4 | 2001-07-21 |
+---------------+----+------------+
4 rows in set (0.00 sec)
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php