Hi guys
I am trying to get the total sum or avg for a column (asp)but some of the values of that column are null, so now i can't add the
column values accurately. Does anyone know how to get around that and be able to calculate the total sum or avg accurately. Any
help is appreciated
THanksMSN 8 helps ELIMINATE E-MAIL VIRUSES. Get 2 months FREE*.
Depending on how (/ whether) you want to calculate the NULL-values, you can
either do this:
SELECT AVG(column) WHERE column IS NOT NULL
which will disregard the rows containing NULL-values, or this:
SELECT AVG(ISNULL(column, 0))
which will calculate rows containing NULL-values as zero.
----- Original Message -----
From: "Neetu Dhatt" <neetu_dhatt@h...>
To: "ASP Databases" <asp_databases@p...>
Sent: Wednesday, January 22, 2003 7:01 AM
Subject: [asp_databases] add or avg with null values
>
> Hi guys
> I am trying to get the total sum or avg for a column (asp)but some of the
values of that column are null, so now i can't add the column values
accurately. Does anyone know how to get around that and be able to calculate
the total sum or avg accurately. Any help is appreciated
> THanksMSN 8 helps ELIMINATE E-MAIL VIRUSES. Get 2 months FREE*.
>
>