SQL IIf not returning true value

superfly5203

Registered User.
Local time
Today, 07:12
Joined
Apr 5, 2016
Messages
43
Hello,

I have the following sql statement
Code:
IIF (CCOdate = null, DateDiff('d',CDApprovalDate, actualdef), DateDiff('d',CCOdate, actualdef)) AS finalchangeage "

The query runs and performs correctly for the false statement, but it doesn't calculate anything for the true part. Any ideas as why only half of the if statement is working?

Thanks
 
IIF (IsNull(CCOdate), ....

or

IIF (Nz(CCOdate, 0) = 0, ....
 
thanks! works great now.
 
you're welcome!
 

Users who are viewing this thread

Back
Top Bottom