Is Not Null will not return false value?
I have the following iif statement in a query:
IIf([jcphase.deptnum] Is Not Null,[jcphase.deptnum],[jcjob.deptnum]) AS calcdeptnum
It returns the correct value if the field is not null, however, it does not return the value in jcjob.deptnum if the field is null. What am I doing wrong? Any advise appreciated.
In case its relevant, the whole query is as follows:
I have the following iif statement in a query:
IIf([jcphase.deptnum] Is Not Null,[jcphase.deptnum],[jcjob.deptnum]) AS calcdeptnum
It returns the correct value if the field is not null, however, it does not return the value in jcjob.deptnum if the field is null. What am I doing wrong? Any advise appreciated.
In case its relevant, the whole query is as follows:
Code:
SELECT jcdetail.jobnum, jcdetail.type, jcdetail.cost, jcdetail.date, jcjob.deptnum, jcphase.deptnum, IIf([jcphase.deptnum] Is Not Null,[jcphase.deptnum],[jcjob.deptnum]) AS calcdeptnum
FROM (jcdetail LEFT JOIN jcjob ON jcdetail.jobnum = jcjob.jobnum) LEFT JOIN jcphase ON (jcdetail.phasenum = jcphase.phasenum) AND (jcdetail.jobnum = jcphase.jobnum)
WHERE (((jcdetail.type)<>18) AND ((jcdetail.date)>#1/1/2009#));
Last edited: