IIf ( [I/O_Travel]="I" AND [Employee]= "Yes", [InState Code], IIf (
[I/O_Travel]="O" AND [Employee]="Yes", [Out of state code], IIf (
[I/O_Travel]="I" AND [Employee]="No", [Non Employee In State Code],IIf (
[I/O_Travel]="O" AND [Employee]="No", [Non Employee Out of state Code]))))
This assumes that the YES and NO field is a text field. If it's a tick
(check) box you may want to use this
IIf ( [I/O_Travel]="I" AND [Employee]= -1, [InState Code], IIf (
[I/O_Travel]="O" AND [Employee]=-1, [Out of state code], IIf (
[I/O_Travel]="I" AND [Employee]=0, [Non Employee In State Code],IIf (
[I/O_Travel]="O" AND [Employee]=0, [Non Employee Out of state Code]))))
I think that these are not the correct field names but I have used them as
you gave them in your example
[InState Code]
[Out of state code]
[Non Employee In State Code]
[Non Employee Out of state Code]
--
Wayne
Manchester, England.
Enjoy whatever it is you do
Scusate,ma il mio Inglese fa schiffo
Percio se non ci siamo capiti, mi mandate un
messagio e provero di spiegarmi meglio.
Chey said:
So after I posted this I realized exactly what I needed. It will end of
being nested
I/O_Travel=I AND Employee=Yes then InState Code
I/O_Travel-O AND Employee=Yes then Out of State Code
I/O_Travel=I AND Employee=No then Non Employee In State Code
I/O_Travel=O AND Employee=No then non employee Out of State Code.
Thanks for all your help
Chey
Wayne-I-M said:
Hi Chey
If the answer can be either (but only) "O" or"I" you don't need to "nest"
Use this
IIF([I/O_Travel]="O",[Out of State Codes.Code],[InState Codes.Codes])
This means that if [I/O_Travel] is anything other than "O" the result will
be the contents of field [InState Codes.Codes]
If the answer was for example [OtherState Codes.Codes]
Then could used a nested if like this
IIf ( ([I/O_Travel]="O", [Out of State Codes.Code], IIf ( ([I/O_Travel]="I",
[InState Codes.Codes], [OtherState Codes.Codes]) )
I think you can have up to 7 nested IIF's - although in that case there
would be better ways to get the results you need.
Hope this helps
--
Wayne
Manchester, England.
Enjoy whatever it is you do
Scusate,ma il mio Inglese fa schiffo
Percio se non ci siamo capiti, mi mandate un
messagio e provero di spiegarmi meglio.
:
I have a query that I created a new filed
Codes2:
I get confused on how to do 2 iff statements in one.
IIF([I/O_Travel]="O",[Out of State Codes.Code])
IIF([I/O_Travel]="I",[InState Codes.Codes])
I am not sure how to combine these.
Thanks
Chey