Problem with iif and datediff expression in form

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.
 
B

benyod79 via AccessMonster.com

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.
 
B

benyod79 via AccessMonster.com

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.
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top