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
 

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

Similar Threads

nested iif function 4
IIF statement 6
Iif Query 5
Excel Message box with days of month & date. 1
Help with 3 scenerio query 1
More Help withthe WHERE Clause 2
Query with IIF Expression Need Help 4
Excel Formatting with dates 3

Top