Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional Expression In Query Criteria

Status
Not open for further replies.

bigmerf

MIS
Oct 4, 2002
247
US
I'm trying to create a query that will select certain information from a table(s). I've added a conditional expression to the "criteria" section of the query that looks like this:

=IIF([Customer]="yes","Customer","")

When I try to run the query, it says that the expression is either typed incorrectly or is too complex to process.

Essentially I want the criteria for my "Branch" field to be "Customer" when the [customer] field = "yes", or "" (null) when the [customer] field = "no".

Am I going about this the wrong way all together using a conditional expression? Should I be using a select statement or something?

Please help!
 
In the criteria cell for Branch, type Customer and in the criteria cell for Customer, type yes

In the Or cell for Branch, type Is Null and in the Or cell for Customer, type no.

 
Hmmmmm, good call. I guess I should have known that....rather than trying to creats some sort of conditional expression on the criteria expression for the one field. I added the following

Field = Branch Customer
Criteria = "Customer" "yes"
Or = <>"Customer" "no"

Thanks for the help. It's nice to have "fresh eyes" look at your work every now and then.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top