|
Posted by Brian Cryer on 09/02/05 18:41
<manning_news@hotmail.com> wrote in message
news:1125674778.208211.43190@z14g2000cwz.googlegroups.com...
> Using SQL2000. According to Books Online, the avg aggregrate function
> ignores null values. ((3+3+3+3+Null)/5) predictably returns Null. Is
> there a function to ignore the Null entry, adjust the divisor, and
> return a value of 3? For example:((3+3+3+3)/4) after ignoring Null
> entry.
>
> If there's more than one null value, then adjust divisor accordingly.
> For example: ((5+5+5+4+Null+5+5+Null)/8) would be ((5+5+5+4+5+5)/6)
> after nulls ignored.
>
> Thanks for any help or advice.
Why not simply change your "where" clause so you aren't picking up null
values?
Brian.
--
www.cryer.co.uk/brian
Navigation:
[Reply to this message]
|