Problem with iif and datediff expression in form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have a form where I have to display the value of the field based on some
criteria.
The first criteria is

=IIf((DateDiff("d",[dbo_PWO_Status].[WorkOrderDate],Now())-180)>0,"Y","")
and the second criteria to add is

dbo_PWO_Status.
= -1

My first question is how do I accommodate the dbo_PWO_Status.
= -1
criteria in the iif statement?

The second question I have is that with the first expression put in the
source for display I am getting Name instead of the Y value for matching
condition. I would appreciate any help. Thanks.
 
You need a nested IIf statement:

=iif([dbo_PWO_Status].
= -1, IIf((DateDiff("d",[dbo_PWO_Status].
[WorkOrderDate],Now())-180)>0,"Y",""), "")




Hi,
I have a form where I have to display the value of the field based on some
criteria.
The first criteria is

=IIf((DateDiff("d",[dbo_PWO_Status].[WorkOrderDate],Now())-180)>0,"Y","")
and the second criteria to add is

dbo_PWO_Status.
= -1

My first question is how do I accommodate the dbo_PWO_Status.
= -1
criteria in the iif statement?

The second question I have is that with the first expression put in the
source for display I am getting Name instead of the Y value for matching
condition. I would appreciate any help. Thanks.
 
Make sure you're referencing the correct field names.

Hi,
I have a form where I have to display the value of the field based on some
criteria.
The first criteria is

=IIf((DateDiff("d",[dbo_PWO_Status].[WorkOrderDate],Now())-180)>0,"Y","")
and the second criteria to add is

dbo_PWO_Status.
= -1

My first question is how do I accommodate the dbo_PWO_Status.
= -1
criteria in the iif statement?

The second question I have is that with the first expression put in the
source for display I am getting Name instead of the Y value for matching
condition. I would appreciate any help. Thanks.
 
Thanks for your help. I appreciate it. Regards

benyod79 via AccessMonster.com said:
Make sure you're referencing the correct field names.

Hi,
I have a form where I have to display the value of the field based on some
criteria.
The first criteria is

=IIf((DateDiff("d",[dbo_PWO_Status].[WorkOrderDate],Now())-180)>0,"Y","")
and the second criteria to add is

dbo_PWO_Status.
= -1

My first question is how do I accommodate the dbo_PWO_Status.
= -1
criteria in the iif statement?

The second question I have is that with the first expression put in the
source for display I am getting Name instead of the Y value for matching
condition. I would appreciate any help. Thanks.
 
Back
Top