Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21849

sum of columns in sql which includes null values

$
0
0
I'm trying to retrieve a field based on a condition as follows.

A11, A13, A21 and A23 are the columns (Number data_type) may contain null values.

My condtion is : Retrieve SubID where (A11+A13-A21) <> A.23

I Put it in Sql like this which throws an error. How to handle Null Values in this case ? My DataBase is MS Access 2007

vSql = "Select SubID from Table31 where Stat = 2 and (ISNULL(A11,0)+ ISNULL(A13,0)- ISNULL(A21,0)) <> (ISNULL(A23,0))"

Viewing all articles
Browse latest Browse all 21849

Trending Articles