Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count in a query by Month 1

Status
Not open for further replies.

LimitedTech

Technical User
Aug 4, 2008
71
US
I am attempting to setup a query that will count the number of records in a given month.

The Field Names used are as follows;

ID
Date
CustomerCode

Currently it groups by each day instead of by month.

I know this is simple but I've looked in the faqs and can't find it.

Thanks for any help.
 
Select count(*) as cstar, CustomerCode,month(date) as m,year(date) as y
from tablename
group by CustomerCode,month(date),year(date)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top