Re: mySQL date query
| From: | Chris | Date: | Tue, 13 Apr 2010 06:25:09 +0000 |
| Subject: | Re: mySQL date query | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-47046@lists.php.net to get a copy of this message | ||
Ron Piggott wrote:
I am trying to write a mySQL query on my "stats" table. I am trying to determine the number of records (users) during a 7 day period ending yesterday. I always to keep it current ... Yesterday will keep changing. In other words I want to know the number of users who accessed the web site during seven full days. This is the beginning of the query. The date column is "date". SELECT count(The mysql manual is a good place to start. http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_date-sub -- Postgresql & php tutorials http://www.designmagick.com/visits) as users FROMstatsWHEREdate