Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 want to get counts based on metric_day_id

Author  Topic 

cplusplus
Aged Yak Warrior

567 Posts

Posted - 2014-04-09 : 16:56:41
I want to get sum of metric_amount for each metric_day_id:
I am using the below query but it is adding the sum's of each month.

if fist month show 40, next month showing 74. meaning it shoudl actally show 34 instead it is adding prior month amount.

How to show individual month amounts.

select metric_day_id, sum(metric_amount) from pillar_metric where metric_id=87012 group by metric_day_id;

Thanks a lot for the helpful info.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2014-04-09 : 20:43:11
please post some sample data and the expected result


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -