Iif Then Else Statment

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.
 
F

fredg

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")
 
T

Thorson

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")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top