combine isnull not isnull

basilyos

Registered User.
Local time
Yesterday, 21:12
Joined
Jan 13, 2014
Messages
256
hello guys
i want to combine (isnull) and (not isnull) in query

iif(isnull[txt1] and not isnull[txt2];true;false)

but it's not right

any help?
 
You need () around the test expression;


Code:
iif(isnull([txt1]) and not isnull([txt2]),true,false)
 
sir am getting this error
the expression you entered has an invalid .(dot) or ! operator or invalid parentheses
You may have entered an invalid identifier or typed parentheses following the Null constant

this is my code
Code:
IIf(IsNull([Phone]+[Mobile]);;IIf(not IsNull([Phone]) and IsNull([Mobile]);[Phone];IIf(not IsNull([Mobile]) and IsNull([Phone]);[Mobile];IIf(not IsNull([Phone]) and not IsNull([Mobile]);[Mobile] & " - " & [Phone];))))
am checking four status
phone is null and mobile is null
phone is null and mobile is not null
phone is not null and mobile is null
phone is not null and mobile is not null
 
Last edited:
You are making this wayyyyy too complicated. What do you want to display based on these checks;

phone is null and mobile is null - Display ?
phone is null and mobile is not null
phone is not null and mobile is null
phone is not null and mobile is not null
 
You are making this wayyyyy too complicated. What do you want to display based on these checks;

phone is null and mobile is null - Display ?
phone is null and mobile is not null
phone is not null and mobile is null
phone is not null and mobile is not null

in the first check nothing
second check mobile
third check phone
fourth check phone and mobile
 
Then you only need to check both once and the other values on their own.

Code:
DisplayedNo: Iff([Phone] Is Not Null And [Mobile] Is Not Null,[Phone] & " - " & [Mobile],IIf([Phone] Is Null,"",[Phone]) & IIf([Mobile] Is Null,"",[Mobile]))
 

Users who are viewing this thread

Back
Top Bottom