Iif Then Else Statment

  • Thread starter Thread starter Thorson
  • Start date Start date
T

Thorson

I need some help writing an If Then Else statment. I have a query that
brings up all the animals at our farm and then the owner of each animal.
Depending on who owns the animal I would like the statment to return
different results.

If the owner is URB, ORR, or DSAC I would like the field to say "Owned by
name" otherwise I would like the field to say "Not Owned by name"

I'm getting stuck on the part with the 3 different options for owner... can
someone help me out?

Thanks.
 
I need some help writing an If Then Else statment. I have a query that
brings up all the animals at our farm and then the owner of each animal.
Depending on who owns the animal I would like the statment to return
different results.

If the owner is URB, ORR, or DSAC I would like the field to say "Owned by
name" otherwise I would like the field to say "Not Owned by name"

I'm getting stuck on the part with the 3 different options for owner... can
someone help me out?

Thanks.

It's not an If .. Then .. Else that you need, but an IIf().

NewColumn:IIf([Owner] In("URB","ORR","DSAC"),"Owned by name","Not
Owned by name")
 
thankyou

fredg said:
I need some help writing an If Then Else statment. I have a query that
brings up all the animals at our farm and then the owner of each animal.
Depending on who owns the animal I would like the statment to return
different results.

If the owner is URB, ORR, or DSAC I would like the field to say "Owned by
name" otherwise I would like the field to say "Not Owned by name"

I'm getting stuck on the part with the 3 different options for owner... can
someone help me out?

Thanks.

It's not an If .. Then .. Else that you need, but an IIf().

NewColumn:IIf([Owner] In("URB","ORR","DSAC"),"Owned by name","Not
Owned by name")
 
Back
Top