Quantcast
Channel: Answers for "sum and count with group by in a single column"
Viewing all articles
Browse latest Browse all 6

Answer by mjharper

$
0
0
I think you just need to include AdjustedDateCompleted in your SELECT and COUNT the rows. So this: select AdjustedDateCompleted, COUNT(*) as BRRCompletedApr13 from dbo.shp_BRRPipelineRemediation where AdjustedDateCompleted >='04/01/2013' and AdjustedDateCompleted <'05/01/2013' GROUP BY AdjustedDateCompleted Order By AdjustedDateCompleted That should give you the number of rows in dbo.shp_BRRPipelineRemediation for each AdjustedDateCompleted between the dates in your WHERE clause.

Viewing all articles
Browse latest Browse all 6

Trending Articles