IIF statement as criteria in a query

R

Robert_DubYa

I am having trouble in regards to using a wild in an iif statement in a
query. My statement looks like this:

IIf(MachineNumb="Machine Numb",like"*",MachineNumb)

When I use this statement and MachineNumb="Machine Numb" I get nothing.
What I would expect is to see everything.

Questions:

1. How do I fix this statement?

2. Why is this happening?

thanks yet again everyone,
Robert
 
O

Ofer

The Like should be outside the IIF statement,try this

Like IIf(MachineNumb="Machine Numb","*",MachineNumb)
 
R

Robert_DubYa

Worked!!!!! I tried everything but. thanks!!!!

Ofer said:
The Like should be outside the IIF statement,try this

Like IIf(MachineNumb="Machine Numb","*",MachineNumb)
 
Top