Results 1 to 6 of 6

Thread: LEN Function

  1. #1
    Join Date
    Jan 2009
    Posts
    4

    Unanswered: LEN Function

    Hello,

    I am using this function to find out where a field is more than 10 characters. I keep returning the fields that contain 10 characters. It has a 16 character limit. Can anyone tell me why it will not pull only those records that are more than 10 characters? I kow there is at least one 11 character field in the table.

    I used Len("ExternalMember" & "")<>"10"

    I have alson tried Greater Than.

    Thanks!

  2. #2
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Len() returns a number, to be specific, an Integer!

    Yu're showing ten as a string!

    You need

    Len("ExternalMember" & "") <> 10

    without the quotations marks.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Or even Len(Nz([ExternalMember],0) <> 10.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  4. #4
    Join Date
    Jan 2009
    Posts
    4
    Quote Originally Posted by Missinglinq
    Len() returns a number, to be specific, an Integer!

    Yu're showing ten as a string!

    You need

    Len("ExternalMember" & "") <> 10

    without the quotations marks.

    Thank you, but it now states the statement has too many closing parentheses when it only has one.

  5. #5
    Join Date
    May 2005
    Posts
    1,191
    What's the whole bit of code that you're using? If it's complaining about too many closing parenthesis, it has to have too few opening parenthesis or you have an extra one somewhere unneeded.

    By the way,
    Quote Originally Posted by Jayden77
    I am using this function to find out where a field is more than 10 characters.
    Then why are you using the not equal to boolean test "<>"? It should be:
    Code:
    Len("ExternalMember") > 10
    Me.Geek = True

  6. #6
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Good catch, Nick! And you're right , of course; as the code posted by the OP and modified here does have matching opening/closing parenthesis, obviously the error is being generated elsewhere.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •