Too many IIF statements

  • Follow


I am trying to compare and check many fields by using many IIF statement to 
do it. However, on access it has the limitation on how many words or 
statments you can put on the query field. My question is what's the best way 
to do this instead of placing the iif statment directly on the query and have 
the same result as run the query?
0
Reply Utf 1/20/2010 2:35:01 PM

Hoachen -

You didn't give many details, but you could write a user-defined function 
for this.  You would pass in whatever criteria you are using in your IIF 
statements, and return the value you are looking for.  In the function, you 
could use a SELECT CASE construct to replace multiple nested IIF statements.  
 If you want more help, you'll need to post your existing IIF statements and 
an explanation of what you want to do.

-- 
Daryl S


"hoachen" wrote:

> I am trying to compare and check many fields by using many IIF statement to 
> do it. However, on access it has the limitation on how many words or 
> statments you can put on the query field. My question is what's the best way 
> to do this instead of placing the iif statment directly on the query and have 
> the same result as run the query?
0
Reply Utf 1/20/2010 2:47:01 PM


IIF statements are limited to 255 characters I think. Sometimes a replace 
statement can work for an IIF. Or you may have to use a select and then case. 
Look in help on those, they are not that difficult to set up.
-- 
Milton Purdy
ACCESS 
State of Arkansas


"hoachen" wrote:

> I am trying to compare and check many fields by using many IIF statement to 
> do it. However, on access it has the limitation on how many words or 
> statments you can put on the query field. My question is what's the best way 
> to do this instead of placing the iif statment directly on the query and have 
> the same result as run the query?
0
Reply Utf 1/20/2010 2:57:04 PM

You can use a table to hold a large set of criteria.
-- 
Build a little, test a little.


"hoachen" wrote:

> I am trying to compare and check many fields by using many IIF statement to 
> do it. However, on access it has the limitation on how many words or 
> statments you can put on the query field. My question is what's the best way 
> to do this instead of placing the iif statment directly on the query and have 
> the same result as run the query?
0
Reply Utf 1/20/2010 3:56:11 PM

3 Replies
380 Views

(page loaded in 0.234 seconds)


Reply: