Thread: Sum plus Group By
09-03-15, 09:12 #1Registered User
- Join Date
- Nov 2005
Unanswered: Sum plus Group By
I have not written a query in a couple years so my skills are rusty. I have table with 5 columns LOCATION TAG_Target TAG_Submitted TAG_Actual DATE
please take a look at Graph below so im trying to get something similar how many actual tags by location by month. I got as far as the script below but how do i get the by month part?
SELECT site, sum (cast (Tags_Actual_Cleared as int))
group by site
Thanks for any help you can provide.
09-03-15, 10:14 #2Annie's Dog Walker
Provided Answers: 6
- Join Date
- Nov 2004
- on the wrong server
You could start by adding TAG_Actual to your GROUP BY and SELECT. However what I think you are after is the PIVOT command...
For information on PIVOT see this....
https://technet.microsoft.com/en-US/...=SQL.105).aspxIf one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry. Earnest Hemingway, A Farewell To Arms.