dbTalk Databases Forums  

Nested IIF ?

comp.database.ms-access comp.database.ms-access


Discuss Nested IIF ? in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Swilson513
 
Posts: n/a

Default Nested IIF ? - 10-14-2003 , 12:33 PM






I print reports that get a different blurb for certain states

I done this in a querie but have created a different one for each
instance

Blurb0: IIf([State]="CA","Use S/A Black For","")
Blurb1: IIf([State]="WA","Use S/A Black For","")
Blurb2: IIf([State]="FL","Use S/A Black For","")

Then just stacked these in the report on top of each other, is there a
way I can use an OR?

Blurb: IIf([State]="CA"or"WA","Use S/A Black For","")

Reply With Quote
  #2  
Old   
Ray
 
Posts: n/a

Default Re: Nested IIF ? - 10-15-2003 , 03:06 AM






swilson513 (AT) aol (DOT) com (Swilson513) wrote in message news:<4fadc0dd.0310140933.4b106423 (AT) posting (DOT) google.com>...
Quote:
I print reports that get a different blurb for certain states

I done this in a querie but have created a different one for each
instance

Blurb0: IIf([State]="CA","Use S/A Black For","")
Blurb1: IIf([State]="WA","Use S/A Black For","")
Blurb2: IIf([State]="FL","Use S/A Black For","")

Then just stacked these in the report on top of each other, is there a
way I can use an OR?

Blurb: IIf([State]="CA"or"WA","Use S/A Black For","")
Hello S. Wilson,

It depends on how far you want to go with this. But the following
example can be used.

Blurb: IIf([State] = "CA", "Use S/A Black For ",
IIf([State]="WA","Use S/A Black For ",null))

You will notice that there are three parts to this. The first
IIf statement, the second IIf statement, and then null. I just
put the null there to show something there. The third part doesn't
have to be there but is a good idea. Could also be: "No State Sourced"
or whatever.

You can put quite a few nested IIf statements in the expression. BUT,
there is a warning. You can only put in so much do to the fact
of the string length that is allowed.

Another suggestion is to look up the "Switch" function. This will
shorten your expression and works the same way. I have used both
depending how long my expression is to be.

Regards,

Ray


Reply With Quote
Reply




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 On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.