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
 Transact-SQL (2000)
 query returning blank

Author  Topic 

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2006-09-04 : 03:05:03
select sum(PAYMENTS.AMOUNT) AS sumofamount from payments

if there are no records -- this is returning a blank instead of 0.
why?

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-09-04 : 03:07:04
the column AMOUNT is all NULL value ?


KH

Go to Top of Page

jonasalbert20
Constraint Violating Yak Guru

300 Posts

Posted - 2006-09-04 : 03:09:05
do the stuff like this...
select sum(isnull(PAYMENTS.AMOUNT,0)) AS sumofamount from payments

Want Philippines to become 1st World COuntry? Go for World War 3...
Go to Top of Page

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-09-04 : 03:14:49
Aha i guess it should be like this

Select IsNull(Sum(PAYMENTS.AMOUNT),0) As SumofAmount From Payments

If no records are returning then....

Chirag
Go to Top of Page
   

- Advertisement -