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))"
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))"