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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help Grouping Dates

Status
Not open for further replies.

tsyle

Programmer
May 16, 2005
35
US
I have a database with queries from:

4/10/2005 Data
4/22/2005 Data
4/23/2005 Data2
5/1/2005 Data
5/5/2005 Data2
5/10/2005 Data2

I want to be able to group everything by month so using the data i gave, i want it to be

April 2005 Data 2
April 2005 Data2 1

May 2005 Data 1
May 2005 Data2 2

Help
 
Something like

Code:
SELECT Format(Datefield, "Mmmm yyyy") As Date, Max (Otherfield) As Otherfield
FROM tablename
GROUP BY Format(Datefield, "Mmmm yyyy")

should do it. You will need to change the name of the table and field.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top