Hi there
How can I, make a queries for the variable length characters. The inputA
field have a length which between 6-4 characters.
I try to use below queries, but got #Errors,
IIF(Len(InputA=6,Left(InputA,6),Left(InputA,4))
How about if 5 characters? How can i put in the queries?
Please help,
Thank you
-Mohsin

Signature
Cheers
Mohsin
Irene - 23 May 2008 06:33 GMT
youe input! is number or text?
> Hi there
>
[quoted text clipped - 10 lines]
> Thank you
> -Mohsin
Max - 23 May 2008 07:50 GMT
Hi ,
Please check syntex for iif(condition,true,false)
it should be
iif(Len(Input)=6,Left(Input,6),Left(Input,4))
max
> Hi there
>
[quoted text clipped - 10 lines]
> Thank you
> -Mohsin
John W. Vinson - 23 May 2008 20:14 GMT
>Hi there
>
[quoted text clipped - 5 lines]
>
>How about if 5 characters? How can i put in the queries?
I'm not quite sure what you're asking!
If you want to find all records in the table with the field of a particular
length, put a calculated field in the query by typing
LenOfA: Len([InputA])
in a vacant Field cell in the query grid. To find all records where InputA is
4 bytes long, put
4
on the criteria. For more flexibility put
[How many characters:]
on the criteria line; you'll be prompted, and can enter 4, 5 or 6 and get the
corresponding result. No IIF() call is needed.

Signature
John W. Vinson [MVP]