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 2000 Forums
 SQL Server Development (2000)
 SUM query help

Author  Topic 

nhaas
Yak Posting Veteran

90 Posts

Posted - 2011-10-19 : 23:25:18
I have a query that is a join. in this query I sum, I noticed that I dont get a when I have a negative and a positive, just two columns.

select
a.bnumber,sum(b.monthcharge) as charge
from
Tesisdev.dbo.BillBudget a
inner join Tesisdev.dbo.Billingcharges b
on b.bnumber = a.bnumber
WHERE b.setvenderid='199'
group by
b.monthcharge,a.bnumber

actually any negative it just puts it in:

559935302539 -1.16
559935302539 -.01
559935302539 14.29


Thnak you

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-20 : 00:40:08
sorry didnt get you. whats output you're expecting?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -