gtjr92
Programmer
- May 26, 2004
- 96
I have a stored procedure that gets the month name and the number of items for that month from a table.
I get all that fine however I cannot get it to orderby or
group by the date name properly.
it sorts it by the actually name instead of the order of the month. ie july is sorted before june
My results look like this
month year count
July 2005 3
June 2005 1
September 2005 1
I get all that fine however I cannot get it to orderby or
group by the date name properly.
it sorts it by the actually name instead of the order of the month. ie july is sorted before june
My results look like this
month year count
July 2005 3
June 2005 1
September 2005 1
Code:
Select distinct datename(Month,DateCreated)As Month,
datepart(year,DateCreated) As Year,count(*) As EntryCount
from blog_entry
WHERE blog_Entry.IsDeleted = 0 And blog_Entry.entBlTopicid='1'
group by datecreated