August 18, 2003 at 5:04 pm
"Warning: Null value is eliminated by an aggregate or other SET operation."
Is there a way of suppressing this warning message?
Thanks in advance,
Billy
August 18, 2003 at 9:23 pm
1. instead of "SUM(Fieldname)" try "SUM(ISNULL(FieldName, 0))"
Caution:
IF you are using avg function your result will be different. Without ISNULL system considers only the NOT NULL entries.
2. If you want the same results but want to remove the warning only add
SET ANSI_WARNINGS OFF
G.R. Preethiviraj Kulasingham
Chief Technology Officer.
Softlogic Information Systems Limited,
14 De Fonseka Place,
Colombo 05.
Sri Lanka.
Cheers,
Prithiviraj Kulasingham
http://preethiviraj.blogspot.com/
August 19, 2003 at 7:24 pm
Thanks!
However, I decide that it is better to put the ISNULL in the code rather than suppress the message. Is it possible to monitor this warning message from SQL Profiler?
Thanks in advance,
Billy
August 19, 2003 at 10:30 pm
Should'nt nulls be excluded entirely from the set being averaged On smaller sets it may have significant effect.
August 20, 2003 at 12:44 am
Hi,
I have seen this before and the following statement suppresses this message:
SET ANSI_WARNINGS OFF
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply