troubleshooting Question

Select dates with most registrations(Year, month, day)

Avatar of mattegol
mattegolFlag for Sweden asked on
Microsoft SQL Server
3 Comments1 Solution282 ViewsLast Modified:

I have a Statistics section were I want to be able to display the year, month and day with the most registrations(for meetings).

There are registrations from 2005-Now. What I want to display is what year that have the most registrations, what month 8For example april 2009) and what day(example December 2nd 2010).

The regsitrations is stored like this "2010-12-24 15:30:45" (Swedish date).
Data type = datetime

I need to count the rows and select the one with the most..

How can I achieve this in my select statements?

Example, End result:
The year with most registrations: 2009, 11876
The month with the most registrations: May 2010, 2983
The day with the most........ September 27nd 2011, 312
Éric Moreau
Senior .Net Consultant
Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros