IIF then function in queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to write an IIF then function that evaluates two fields to
determine what the result should be and I'm having trouble.

Example of what I'm trying to do:

iif([field 1]="R" & [field 2]="3","K",[field 1])

I need field 1 to be R AND field 2 to be 3 in order for "K" to be valid
 
Try:
IIf([field 1]="R" And [field 2]="3","K",[field 1])
If Field 3 is numeric:
IIf([field 1]="R" And [field 2]=3,"K",[field 1])
 
Thank you so much. Field 2 is numeric and I kept including the quotation
marks, so it wasn't evaluating properly. I feel like I tried everything and
thought I even tried not using the quotes....but I guess I didn't.

Appreciate it!

Duane Hookom said:
Try:
IIf([field 1]="R" And [field 2]="3","K",[field 1])
If Field 3 is numeric:
IIf([field 1]="R" And [field 2]=3,"K",[field 1])



--
Duane Hookom
MS Access MVP
--

access97user said:
I am trying to write an IIF then function that evaluates two fields to
determine what the result should be and I'm having trouble.

Example of what I'm trying to do:

iif([field 1]="R" & [field 2]="3","K",[field 1])

I need field 1 to be R AND field 2 to be 3 in order for "K" to be valid
 
Back
Top