Select monthname(yourdatefield) as month, year(yourdatefield) as year,
count(*)
>From yourtable
Group by year, month;

Jeff McKeon
IT Manager
Telaurus Communications LLC
[EMAIL PROTECTED]
(973) 889-8990 ex 209 

***The information contained in this communication is confidential. It
is intended only for the sole use of the recipient named above and may
be legally privileged. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution
or copying of this communication, or any of its contents or attachments,
is expressly prohibited. If you have received this communication in
error, please re-send it to the sender and delete the original message,
and any copy of it, from your computer system. Thank You.***



> -----Original Message-----
> From: Terence [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, August 20, 2003 1:16 AM
> To: Scott Haneda; MySql
> Subject: Re: month by month count
> 
> 
> select count(*), monthname(yourfield)
> from yourtable
> where year = '2003'
> group by monthname(yourfield)
> 
> ----- Original Message ----- 
> From: "Scott Haneda" <[EMAIL PROTECTED]>
> To: "MySql" <[EMAIL PROTECTED]>
> Sent: Wednesday, August 20, 2003 12:38 PM
> Subject: month by month count
> 
> 
> I need to generate record counts for each month in a year, 
> just one year at a time, but a full year at a glance.
> 
> I am thinking 12 hits to the DB is perhaps not the most idea 
> way to do it, is there a way to rip this out in one go?
> -- 
> -------------------------------------------------------------
> Scott Haneda                                Tel: 415.898.2602
> http://www.newgeo.com                       Fax: 313.557.5052
> [EMAIL PROTECTED]                            Novato, CA U.S.A.
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    
> http://lists.mysql.com/mysql?> [EMAIL PROTECTED]
> 
> -- 
> 
> MySQL General Mailing List
> 
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    
> http://lists.mysql.com/mysql?> [EMAIL PROTECTED]
> 
> 

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to