Use of "AND" in an IIf statement

magster06

Registered User.
Local time
Today, 16:23
Joined
Sep 22, 2012
Messages
235
Hello All,

Is there a way to use the "AND" operator in an IIf statement?

I have two statements that need to run in the control source of a control.

Code:
IIf(DateDiff('d',[LDStartDate],Date())>=366,"*","")

Checks to see if the LD Start Date is over a year old.

Code:
,IIf(IsNull([LDEndDate],"*","")

Checks to see if the LD End Date field is null.

Like I mentioned, I am using this in the control source property of a textbox control in a report.

Or, should I use this in the Current Event of the report? and if so, then would it look something like this:

Code:
IIf(AND(IIf(IsNull([LDEndDate),"*","",(IIf(DateDiff('d',[LDStartDate],Date())>=366,"*","")
 
magster06, see if this helps..
Code:
IIF(IsNull([LDEndDate)[COLOR=Red][B] AND [/B][/COLOR]DateDiff('d', [LDStartDate], Date())>=366, "*", "")
 
pr2-eugin,

That works!

I was trying the true, false part in both statements, arrgh.

Thanks pr2-eugin!!
 

Users who are viewing this thread

Back
Top Bottom