A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Help please with nested iif



 
 
Thread Tools Display Modes
  #1  
Old March 3rd, 2010, 08:45 AM posted to microsoft.public.access.queries
alecgreen
external usenet poster
 
Posts: 45
Default Help please with nested iif

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
  #2  
Old March 3rd, 2010, 09:32 AM posted to microsoft.public.access.queries
Krzysztof Naworyta
external usenet poster
 
Posts: 80
Default Help please with nested iif

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
)
)

--
KN
  #3  
Old March 3rd, 2010, 11:55 AM posted to microsoft.public.access.queries
alecgreen
external usenet poster
 
Posts: 45
Default Help please with nested iif

On 3 Mar, 08:32, "Krzysztof Naworyta"
wrote:
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
* * * * * * )
* * )

--
KN


Brilliant, Thanks
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:35 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.