Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / May 2008

Tip: Looking for answers? Try searching our database.

Len Function

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mohsin - 23 May 2008 05:29 GMT
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]

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.