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

Order by Month (text format)

Status
Not open for further replies.

Paladyr

Programmer
Apr 22, 2001
508
US
I have a query that is counting records and organizing them by month (Jan, Feb, Mar, etc...). The problem is, the query organizes the month alphabetically instead of by the month they represent. Is there an easy way to do this?? Even if I use the numbers it goes 1, 10, 11, 12, 2, etc... Thanks!
 
Hello

Put the date/time field in the query if it isn't already there, and sort by it. This also has the advantage if that they run over separate years, the months entries for separate years will be counted separately.

John
 
Code:
? MonthName(1)
January[code]





MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
I can't put the date/time field in there because then I couldn't sum the records by month. Forgive me Michael but I haven't the slightest clue where I'm supposed to put that :). Here's the query:

[/code]
SELECT [main table].[Internal Contact], Format([due date],"mmm") AS [Month], Count([Request#]) AS NumOfCalls
FROM [main table]
WHERE [main table].[due date]>=[Enter Start Date] And [main table].[due date]<=[Enter End Date]
GROUP BY [main table].[Internal Contact], Format([due date],&quot;mmm&quot;);
Code:
Also, this is in Access so it may not support certain syntax.
 
Month(Date) is how you do it. Thanks anyway!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top