Help please with nested iif

A

alecgreen

Hi

I am trying to create a nested iif, for the following scenerio - but I
am having difficulties

if due date is less than today, show yesterdays date.
if due date is between today and today plus 14 days, show the current
due date.
if due date is greater than today plus 14 days, show the current due
date plus 15 days.

I have managed the basic iif (true/false), but cant evaluate the rest!

Many Thanks

Alec
 
K

Krzysztof Naworyta

alecgreen wrote:

| I am trying to create a nested iif, for the following scenerio - but I
| am having difficulties
|
| if due date is less than today, show yesterdays date.
| if due date is between today and today plus 14 days, show the current
| due date.
| if due date is greater than today plus 14 days, show the current due
| date plus 15 days.

IIF([Field1]<date();
date()-1;
IIF(Field1]>=date() and [Field1]<=date()+14;
date();
date()+15
)
)
 
A

alecgreen

alecgreen wrote:

| I am trying to create a nested iif, for the following scenerio - but I
| am having difficulties
|
| if due date is less than today, show yesterdays date.
| if due date is between today and today plus 14 days, show the current
| due date.
| if due date is greater than today plus 14 days, show the current due
| date plus 15 days.

IIF([Field1]<date();
        date()-1;
        IIF(Field1]>=date() and [Field1]<=date()+14;
            date();
            date()+15
            )
    )

Brilliant, Thanks
 
Top