Results 1 to 4 of 4
  1. #1
    Jen0dorf is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453

    code check pllease

    Hi

    I have 35000 records and I have a field designated

    Yearofbaptism. The field is formatted text and contains records such as the following

    1856
    1856/57

    I want to create a query that will only show the records with 5 characters or more.

    I created the following sql but it does not do what I want



    Code:
    SELECT tbl_Baptism.YearOfBaptism, tbl_Baptism.FullDateOfBaptism
    FROM tbl_Baptism
    WHERE ((("len [yearofbaptism]")>"5"));
    Where have I gone wrong?

    thanks

    Ian

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    in the query:

    field: LEN([yearofbaptism])
    criteria >5


    ...WHERE (((Len([yearofbaptism]))>5));

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Perhaps you need >= operator.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    Jen0dorf is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453
    Thanks that was it

    IAn

    Quote Originally Posted by ranman256 View Post
    in the query:

    field: LEN([yearofbaptism])
    criteria >5


    ...WHERE (((Len([yearofbaptism]))>5));

Please reply to this thread with any new information or opinions.

Similar Threads

  1. query code check please
    By Jen0dorf in forum Access
    Replies: 1
    Last Post: 09-09-2016, 05:08 AM
  2. update sql code check
    By Jen0dorf in forum Access
    Replies: 3
    Last Post: 01-28-2016, 04:40 AM
  3. Replies: 2
    Last Post: 07-27-2015, 05:20 PM
  4. Replies: 5
    Last Post: 06-26-2014, 12:52 PM
  5. Replies: 4
    Last Post: 03-10-2014, 12:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums