From: gambler on
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
From: Duane Hookom on
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
From: gambler on
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
From: Bob Barrows on
We are not looking over your shoulder at your computer screen. Please try
and describe your symptoms without using generic, meaningless terms like
"fails" and "didn't work". What happened when you tried Duane's suggestion?
Error message? What was it?
Incorrect results? Try and explain what was wrong with them. If you need to,
show examples of the data, followed by what the result of Duane's suggestion
was, followed by what you want the result to look like.

gambler wrote:
> 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

Impossible. The IIF() function requires 3 arguments and you've only supplied
2.

> 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

--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


From: Dirk Goldgar on
"Bob Barrows" <reb01501(a)NOyahoo.SPAMcom> wrote in message
news:OfWyZOs7KHA.1316(a)TK2MSFTNGP02.phx.gbl...
>
> Impossible. The IIF() function requires 3 arguments and you've only
> supplied 2.


Quite possible, actually. While the VBA IIf() function requires all 3
arguments, the JET SQL IIf() function does not. In a query, it's the SQL
version of the function that will be used, not the VBA function of the same
name.

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)