Thread: IIF STATEMENT
View Single Post
  #3  
Old May 8th, 2010, 02:01 AM posted to microsoft.public.access.queries
gambler
external usenet poster
 
Posts: 13
Default IIF STATEMENT

My table is ALL_HX4
I wrote a query PL5HX4. tHIS IS WHERE rk is located.
Then i wrote another query LU. It is in here that i put my iif statement.
Your suggestion didnt work.
If i write the IIf sattement as K:IIF([PL5HX4.RK]=1,2)iT WORKS
When i write it and include the second IIF statement it fails. Hope i
explained myself clearly. If not please let me know.
Thanks Duane
ed

"Duane Hookom" wrote:

It looks like you have an extra 0 in there. This seems like unusual
bracketing of the table and field name.
K:IIF([PL5HX4].[RK]=1,2,IIF([PL5HX4].[RK]=2,1,0))

You could rewrite this as the following if the possible values for RK as
1,2, or 3.
K:Choose([PL5HX4].[RK],2,1,0)

--
Duane Hookom
Microsoft Access MVP


"gambler" wrote:

When i write the following IIF statement i get the error mesage WRONG #
ARGUMENTS. What am i doing wrong?
K:IIF([PL5HX4.RK]=1,2,0IIF([PL5HX4.RK]=2,1,0))
tHANKS
ED