View Full Version : Help with Iif statement in a query


ds0203
04-28-2009, 09:22 AM
Hi all,

I'm trying to perform a query in which if the pump_type begins with the word "none" then I want it to populate exactly what is in the pump_type field. If that field contains anything else, I want it to say "dedicated-" and then what is in the pump_type field.

What do I have wrong with my iif statement below? It keeps populating "dedicated-" and the pump_type field for all of the records - even those that have none in them.


Pump_Type_NEW: IIf([pump_type]="none*",[pump_type],"Dedicated-" & [pump_type])

thanks!
ds

pbaldy
04-28-2009, 09:28 AM
In order to use a wildcard, you need to use Like instead of =.

ds0203
04-28-2009, 09:36 AM
Thanks, that worked great!