If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
IIF STATEMENT
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 |
#2
|
|||
|
|||
IIF STATEMENT
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 |
#3
|
|||
|
|||
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 |
#4
|
|||
|
|||
IIF STATEMENT
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" |
#5
|
|||
|
|||
IIF STATEMENT
"Bob Barrows" wrote in message
... 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) |
#6
|
|||
|
|||
IIF STATEMENT
Dirk Goldgar wrote:
"Bob Barrows" wrote in message ... 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. Learn something new every day, I guess. I always assumed it was using the VBA function and never realized there was a JetSQL version. I assume it returns Null if the test expression fails and no false result is supplied ... -- 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" |
Thread Tools | |
Display Modes | |
|
|