limitation of characters in query?


X

xiaodan86

I am trying to write a condition in my query using IIf statement and
the statement is quite long.
But I facing a problems that I am not able to type out all the
condition in the query.
Is there any limits for character type in the query field?
 
Ad

Advertisements

J

John W. Vinson

I am trying to write a condition in my query using IIf statement and
the statement is quite long.
But I facing a problems that I am not able to type out all the
condition in the query.
Is there any limits for character type in the query field?
Yes: 1024 bytes if I recall aright. Help for "Specifications" will get the
straight scoop.

Big complex nested IIF statements usually indicate either a need for another
table, or an alternative approach. The Switch() function can do multiple IF
conditions; it takes arguments in pairs, evaluates the pairs left to right,
and when it first encounters a pair where the first argument is TRUE it
returns the second of the pair.

If it's a multiple value lookup - consider creating a simple translation
table. You can replace

IIF(Code = 1, "A", IIF(Code = 2, "B", IIF(Code = 3, "C", IIF....))))))))))))

with a simple table with two fields, Code and Result; join this to your table
by Code and display the Result.


John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top