nested IIF query problem

S

shanej

the following query is supposed to give me all non-null if "Published",
or all null if "Unpublished, or both if anything else. It only works
for Published. I tried each of the pieces seperalty and they work fine,
but not together in nested IIFs. Here is the query broken down for ease
or reading:

Like (IIf([forms].[F_Opinion_View].[OPpub]="Published",
"*/*/*",
(IIf([forms].[F_Opinion_View].[OPpub]="Unpublished",
([our_opinions].[OP_published]) Is Null,
(([our_opinions].[OP_published]) Like "*/*/*" Or
([our_opinions].[OP_published]) Is Null)))))


FYI: the field is a date field.

any ideas?
 
G

geebee

hi,

try this:

FACTOR:
IIf([forms].[F_Opinion_View].[OPpub]="Published","*/*/*",IIf([forms].[F_Opinion_View].[OPpub]="Unpublished",Null,"BOTH"))

Hope this works. Let me know!

geebee
 
S

shanej

no...it seems that it is just too complex. i'm now trying to use the
form to send the proper expression. see my new post.
geebee said:
hi,

try this:

FACTOR:
IIf([forms].[F_Opinion_View].[OPpub]="Published","*/*/*",IIf([forms].[F_Opinion_View].[OPpub]="Unpublished",Null,"BOTH"))

Hope this works. Let me know!

geebee


shanej said:
the following query is supposed to give me all non-null if "Published",
or all null if "Unpublished, or both if anything else. It only works
for Published. I tried each of the pieces seperalty and they work fine,
but not together in nested IIFs. Here is the query broken down for ease
or reading:

Like (IIf([forms].[F_Opinion_View].[OPpub]="Published",
"*/*/*",
(IIf([forms].[F_Opinion_View].[OPpub]="Unpublished",
([our_opinions].[OP_published]) Is Null,
(([our_opinions].[OP_published]) Like "*/*/*" Or
([our_opinions].[OP_published]) Is Null)))))


FYI: the field is a date field.

any ideas?
 
Top