IIF in IF portion of Query

  • Thread starter Thread starter Lonnie Schaible via AccessMonster.com
  • Start date Start date
L

Lonnie Schaible via AccessMonster.com

I have an Access database that lists multiple items within a text string in a
single field that I want to recode into several binary variables. In other
words, if a "*STEREO*" is listed, I would like to create a field titled
STEREO that is equal to either 0/1. How might I express a function
equivalent to the following expression to do this appropriately:

IIF(
![FIELD]="*STEREO*",0,1)

Any help would be greatly appreciated!

Thanks,

Lonnie
 
IsStereo: IIF(
![FIELD] LIKE "*STEREO*", -1, 0)

By convention in Access / JET / VBA, True = -1 and False = 0.

HTH
Van T. Dinh
MVP (Access)
 
Back
Top