|
-
Jan 28th, 2009, 07:36 AM
#1
Thread Starter
Lively Member
checking NULL in SQL and replacing it with zero in VB6
Hi,
I need to check NULL in SQL and replace it with zero.My database is in MS Access. Access has a function NZ which does this job when you are in Access.
but when used in SQL in VB6 and run it gives error, it doesn't recognize function.There is another function ISNULL but it just checks the value is NUll
and returns -1 if is null in SQL .
like select ISNULL(sum(quantity)) from inventary;
it returns -1 if it is null otherwise 0 means the result of this query is not the sum of quantity if it is not null but 0.
in select NZ(sum(quantity),0) from inventary;
it returns 0 if null otherwise the sum.
Please response quick!
Ayyaz
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|