SELECT YEAR(DateColumn) AS [Year],MONTH(DateColumn) AS [Month],COUNT(*) from yourtable Group
By YEAR(DateColumn) MONTH(DateColumn)
|
Type
|
CreateDate
|
Technology
|
2012-11-18 09:00:00:00
|
Social Network
|
2012-11-28 09:29:00:00
|
Education
|
2012-11-30 10:30:20:00
|
Politics
|
2012-10-04 04:20:33:59
|
Software
|
2012-10-03 04:20:33:59
|
Hardware
|
2012-10-02 04:20:33:59
|
Teaching
|
2012-10-01 04:20:33:59
|
Tech Support
|
2012-09-28 09:00:00:00
|
Customer Support
|
2012-09-10 09:00:00:00
|
DECLARE @temp TABLE (ID INT,Location varchar(120))
INSERT INTO @temp VALUES(1,'Near to Men''s Hostel')
SELECT * FROM @temp
|
Year
|
Month
|
Count
|
2012
|
9
|
2
|
2012
|
10
|
4
|
2012
|
11
|
3
|
|
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
Subscribe by RSS
Subscribe by Email
|
|||
|
|
Subscribe by RSS
Subscribe by Email
1 comments :
how to show nonthly report click on the month radiobotton