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

Author  Topic 

tracy5436
Yak Posting Veteran

50 Posts

Posted - 2008-04-08 : 15:19:09
I am getting the message "Warning: Null value is eliminated by an aggregate or other SET operation." when I run my query, but the query produces no nulls. Why am I getting this warning ?

nr
SQLTeam MVY

12543 Posts

Posted - 2008-04-08 : 15:24:33
It's just warning that they are being ignored by an aggregate function - sum, max etc.
You can set the warnings off but better to avoid them if it's a problem.

for a sum you can just use a coalesce
sum(coalesce(col,0))
For max or min you can do a similar thing but need to be careful that your default doesn't turn out to be the result.
For other aggregates make your own decision.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -