iif help!

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

Hi,

I'm trying to use an IIF statment in a query to Select
either a Queue_Type or All queue types - as specified by
the User, by asking for a value of either the Queue name
or the word All.

Under the Queue_Type field in the query;
IIf([Select_Queue]<>'All',[Select_Queue],Not Null)

The query works when I enter a Queue_Type, but does not
bring back all the records when I type All.

Can anyone help?

Thanx,
Steve.
 
Try entering the following in the criteria cell

([Select_Queue] or [Select_Queue]='All')

Access will probably restructure this when you close the query, but unless you
have a lot of criteria in the query this should work.
 
Thanks for that John.

Works a treat :)

I cant see how it works, but jobs a good one!

Cheers,
Steve.
-----Original Message-----
Try entering the following in the criteria cell

([Select_Queue] or [Select_Queue]='All')

Access will probably restructure this when you close the query, but unless you
have a lot of criteria in the query this should work.

Hi,

I'm trying to use an IIF statment in a query to Select
either a Queue_Type or All queue types - as specified by
the User, by asking for a value of either the Queue name
or the word All.

Under the Queue_Type field in the query;
IIf([Select_Queue]<>'All',[Select_Queue],Not Null)

The query works when I enter a Queue_Type, but does not
bring back all the records when I type All.

Can anyone help?

Thanx,
Steve.
.
 
Further to this question, If the user types All (I'm
actually using a Combo-box on a form), how would I display
the data for just 2 of the queue types rather than All of
them?

I have tried ([Select_Queue] or [Select_Queue] = ('MTHLY'
OR 'NONMY')) but that didnt work.

Any help is appreciated.

Cheers,
Steve.
 
Steve,

No IIfs or Buts:

[Select_Queue] Or [Select_Queue]="All"

- Steve Schapel, Microsoft Access MVP
 
Steve,

[Select_Queue] Or (In("MTHLY","NONMY") And [Select_Queue]="All")

- Steve Schapel, Microsoft Access MVP
 
Steve,

No IIfs or Buts:

Syntax correction: No IIfs or Butts.
[Select_Queue] Or [Select_Queue]="All"

- Steve Schapel, Microsoft Access MVP


Hi,

I'm trying to use an IIF statment in a query to Select
either a Queue_Type or All queue types - as specified by
the User, by asking for a value of either the Queue name
or the word All.

Under the Queue_Type field in the query;
IIf([Select_Queue]<>'All',[Select_Queue],Not Null)

The query works when I enter a Queue_Type, but does not
bring back all the records when I type All.

Can anyone help?

Thanx,
Steve.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 
Back
Top