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
 Transact-SQL (2005)
 Warning: Null value is eliminated by an aggregate

Author  Topic 

AnnieM
Starting Member

6 Posts

Posted - 2009-07-28 : 12:00:31
Hi all,

I am very happy to find this forum dedicated to SQL!

I received this warning "Warning: Null value is eliminated by an aggregate or other SET operation." with an Insert statement. I've confirmed that the results are correct despite the warning Nonetheless, I'd like to fix the warning if possible. Here's one of the culprit clauses:

CASE SUM(case ISNULL(curCSAP_Reading,0) WHEN 0 THEN 0 ELSE 1 END)
/* avoid divide by zero problem */
WHEN 0 THEN 0 ELSE
SUM(curCSAP_ReadPct_to_P)/SUM(case ISNULL(curCSAP_Reading,0) WHEN 0 THEN 0 ELSE 1 END) END AS curRead_Ave

Does anyone know how to reword that so I don't get the warning?

Much thanks and happy programming!

Annie

X002548
Not Just a Number

15586 Posts

Posted - 2009-07-28 : 12:18:28
SET ANSI_WARNINGS OFF

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

AnnieM
Starting Member

6 Posts

Posted - 2009-07-28 : 17:55:44
Thank you for your help, Brett!
Annie
Go to Top of Page
   

- Advertisement -