IIf Statments in queries


Can someone help me with the formatting of a line of my query. I am trying to say;
if column[7] is null then check column [19], if they are both null return FALSE.
if column[7] is not null check its value is greater than 0, if it is not greater than 0, check column [19] value is greater than 0, if it is also not greater than 0 return FALSE, but if either column [7] or [19] return a value greater than 0 return TRUE.

I have tried to do this in a query, and I need to keep it in this format.

dox_fsa: IIf(IsNull([7]),IIf(IsNull[19],False,IIf([7]>0,True,IIF[19]>0,True,False))

Something like that?

Who is Participating?
Rey Obrero (Capricorn1)Commented:
try this

dox_fsa: IIf([7] is null and [19] is null,False,IIf([7]>0 Or [F19]>0,True,False))
use the NZ() function instead of IsNull in queries

it works better for me...
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
dox_fsa: IIf(IsNull([7]),IIf(IsNull[19],False, IIf([19]>0,True,False)),IIf([7]>0,True,IIf(isNull([19]),False,IIf([19]>0,True,False)))

  Think I got enough parends on the end.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.