SQL question (DATEDIFF and COUNT)

I have a table that holds ServiceTickers that has a  DateEntered and DateResolved columns. I wish to make a stored procedure that returns the difference in days between the two dates and sums up how many have that date difference. I.E. I want to know how many 3-day tickets there are, how many 4-day etc.

RuralInstituteAsked:
Who is Participating?
 
rafranciscoConnect With a Mentor Commented:
Try this:

SELECT DATEDIFF(DD, DateEntered, DateResolved), COUNT(*)
FROM YourTable
GROUP BY DATEDIFF(DD, DateEntered, DateResolved)
0
All Courses

From novice to tech pro — start learning today.