RE: [PHP] MySQL query for average records per day
| From: | Gryffyn, Trevor | Date: | Thu, 16 Sep 2004 18:50:58 +0000 |
| Subject: | RE: [PHP] MySQL query for average records per day | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-196892@lists.php.net to get a copy of this message | ||
Select date1,count(date1) group by date1 where date1 <> '$today'
That'll get you the count of how many records were done on each day
(excluding today). I don't know what you're trying to average, but you
can probably figure it out from there.
-TG
> -----Original Message-----
> From: Jeff Oien [mailto:jeff@webdesigns1.com]
> Sent: Thursday, September 16, 2004 2:35 PM
> To: PHP
> Subject: [PHP] MySQL query for average records per day
>
>
> I have a database with a date field in this format
> 20041016
> I'd like to count how many records were made on each day
> (except today)
> and average them. Can I do this in one query or will I need
> to do some
> more PHP stuff after I get some results? Thanks.
>
> Bare bones so far:
> $sql = "select date1 from $table_name where date1 != '$today'";
> Jeff
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>