Question:
How can I make an Access query display a zero for a null result?
Pun
2007-07-10 03:30:57 UTC
I am trying to count fields in a query, but when the result is null, I do not get a result displayed. I want to use the result in a graph, so it must display "0" when a null is returned. I have tried using the Nz function with no luck.
Three answers:
keep_smiling_n_be_happy
2007-07-10 03:46:25 UTC
Hare Krsna

Dear & Respected Friend...



In the query use the "IIF" construct like this way.



Suppose the field that needs to be checkeds is xx.



So use it like - IIF(IsNull(xx), 0, xx)



In the above case if XX is null automatically 0 will be replaced with that.



Happy Programming

Take Care

keep Smiling and be happy

Hare krsna
Bunny
2007-07-10 10:56:09 UTC
In ORACLE, there is a method named NVL method. This is method which fuctions on NULLS. This is used to replace a NULL value other any other value.



Here are the syntaxs:



select NVL(,0) from ;



ex:= select nvl(comm,0) from emp;
anonymous
2007-07-10 10:34:50 UTC
Check the property of the field in question and there should be a default value property and put a zero in there.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...