I'm trying to set up a nested IIF statement in a query and I'm striking out.
Basically I'm trying to do the following:
If "Field A" and "Field B" are both blank, "Enter This Text" OR If "Field A"
is NOT blank, "Enter That Text".
Any ideas??
Thanks in adavnce.
Frank
|
|
0
|
|
|
|
Reply
|
Utf
|
1/22/2010 2:34:01 PM |
|
hi Frank,
On 22.01.2010 15:34, FrankTimJr wrote:
> I'm trying to set up a nested IIF statement in a query and I'm striking out.
>
> Basically I'm trying to do the following:
>
> If "Field A" and "Field B" are both blank, "Enter This Text" OR If "Field A"
> is NOT blank, "Enter That Text".
Iif(Len(Trim(Nz([FieldA], ""))) > 0,
"Enter That Text",
Iif(Len(Trim(Nz([FieldB], ""))) = 0), "Enter This Text", "???")
mfG
--> stefan <--
|
|
0
|
|
|
|
Reply
|
Stefan
|
1/22/2010 2:53:00 PM
|
|
You haven't indicated what to do if A is blank and B is not.
Assuming you leave the text blank for this column, perhaps something like
this:
IIf([A] Is Null, IIf([B] Is Null, "Enter this text", Null), "Enter that
text")
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"FrankTimJr" <FrankTimJr@discussions.microsoft.com> wrote in message
news:A6EB05D6-9956-4C41-A343-2DEF57DBDB67@microsoft.com...
> I'm trying to set up a nested IIF statement in a query and I'm striking
> out.
>
> Basically I'm trying to do the following:
>
> If "Field A" and "Field B" are both blank, "Enter This Text" OR If "Field
> A"
> is NOT blank, "Enter That Text".
>
> Any ideas??
> Thanks in adavnce.
> Frank
|
|
0
|
|
|
|
Reply
|
Allen
|
1/22/2010 2:55:08 PM
|
|
Frank -
You didn't say what the result should be for when A is null and B is not, so
I made something up for that. Here goes:
IIF(isnull([Field A]),iif( isnull([Field B]),"Enter This Text","A null B not
null"),"Enter That Text")
--
Daryl S
"FrankTimJr" wrote:
> I'm trying to set up a nested IIF statement in a query and I'm striking out.
>
> Basically I'm trying to do the following:
>
> If "Field A" and "Field B" are both blank, "Enter This Text" OR If "Field A"
> is NOT blank, "Enter That Text".
>
> Any ideas??
> Thanks in adavnce.
> Frank
|
|
0
|
|
|
|
Reply
|
Utf
|
1/22/2010 2:56:01 PM
|
|
IIF([FieldA] is Null and [FieldB] is Null,"Both Null"
, IIF([FieldA] is not null,"Field A has a Value",
, IIF([FieldB] is not null,"Field B has a Value",Null)))
John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
FrankTimJr wrote:
> I'm trying to set up a nested IIF statement in a query and I'm striking out.
>
> Basically I'm trying to do the following:
>
> If "Field A" and "Field B" are both blank, "Enter This Text" OR If "Field A"
> is NOT blank, "Enter That Text".
>
> Any ideas??
> Thanks in adavnce.
> Frank
|
|
0
|
|
|
|
Reply
|
John
|
1/22/2010 3:11:46 PM
|
|
|
4 Replies
1454 Views
(page loaded in 0.005 seconds)
Similiar Articles: Nested IIF Statement in a query - microsoft.public.access.queries ...I'm trying to set up a nested IIF statement in a query and I'm striking out. Basically I'm trying to do the following: If "Field A" and "Field B... Nested IIf and IsNull - microsoft.public.access.queries ...Nested IIf and IsNull - microsoft.public.access.queries ... Nested IIF Statement in a query - microsoft.public.access.queries ... I'm trying to set up a nested IIF ... Nested "IIF" or....? - microsoft.public.access.reports ...I'm trying to set up a nested IIF statement in a query and I'm striking out. Basically I'm trying to do the following: If "Field A" and "Field B... joining two iif statements - microsoft.public.access.queries ...If so you need one IIF nested inside another, or, perhaps better, the builtin ... Nested IIF Statement in a query - microsoft.public.access.queries ... joining two iif ... Iif Statement help - microsoft.public.accessHi, basically i need a soltuion which is a huge Iif statement ibelieve maybe a nested Iif ... IIF statement in query criteria, help! - microsoft.public.access ... IIF ... What do I need: multiple nested IIF? Switch()? DateDiff ...limitation of characters in query? - microsoft.public.access ... Big complex nested IIF statements usually indicate either a need for another table, or an alternative ... Date comparison in IIF statement in a query - microsoft.public ...DateDiff ..... can use the NZ function to make sure that you have a comparison date. DateDiff("d", IIF ... Nested IIF Statement in a query - microsoft.public.access ... IIf statement too long. Other options? - microsoft.public.access ...IIf statement too long. Other options? - microsoft.public.access ... I'm trying to set up a nested IIF statement in a query and I'm striking out. ... IIF statement in query criteria, help! - microsoft.public.access ...Nested IIF Statement in a query - microsoft.public.access.queries ... IIF statement in query criteria, help! - microsoft.public.access ... Using IIF statement in query ... IIf statement in query criteria - microsoft.public.access.queries ...Hello, I am using an iif statement in a query criteria. It draws data from a dropdown ... 101.3 PassFail should say "Pass" Should this be done using nested IIF statements ... Nested IIF Statement - Microsoft AccessAs mentioned earlier a nested IIF statement is many IIF statements nested within each other. For this tip I am using a query, but you can just as easily use this in an ... Nested IIF Statement in a query DataBase - DataBase Discussion ...I am trying to set up a nested IIF statement in a query and I am striking out. Basically I am trying to do the following: If Field A and Field B are bot IIf Function - Access - Office.com - Microsoft Corporation ...... can use any expression as any part of an IIf statement. ... Since each nested IIf function is the falsepart argument ... Use IIf in a query The IIf function is frequently used ... Nested IIF Statement in a query - microsoft.public.access.queries ...I'm trying to set up a nested IIF statement in a query and I'm striking out. Basically I'm trying to do the following: If "Field A" and "Field B... Nested IIf() statements in query - dBforumsHi. I was wondering if anyone knew of a way to have a query that runs a specific nested IIf statement based on a certain company. The way I have it 7/19/2012 3:28:00 PM
|