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 2005 Forums
 Other SQL Server Topics (2005)
 sum function

Author  Topic 

taniarto
Starting Member

27 Posts

Posted - 2013-03-27 : 03:56:19
Dear all

I have some record like below :

PropertyID Amount Type EndDate
--------------------------------------------
1 100 RENT null
1 50 WATER null
1 60 ELEC null
1 10 OTHER null
2 70 RENT null
2 10 WATER null

And I have another table (table header) recording the summary of those record can result like this
ID Type Total
1. Rent 170
2. Water 60
3. Elec 60
4. Other 10

Its contain the summarize of the detail record
I try to make a command like
update total=sum(amount) from detail ...but the result is total of the record not by the id of item..

thanks
   

- Advertisement -