Results 1 to 3 of 3
  1. #1
    Dave14867's Avatar
    Dave14867 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Nov 2016
    Location
    Upstate NY
    Posts
    376

    Want to find any record containing any part of a string

    I have a query and want it to show me any records that contain any part of a string. I have this in the Criteria - Like "*" & [Enter Lot Number] & "*". It only shows me 1 record and I know there are 2. The first record contains only that string of numbers, the second contains another string followed by a comma and space then the Lot Number I entered.



    My Criteria is only showing me a record where the Lot Number is by itself.

    Does Show 802407

    Doesn't show 802339, 802407

    How do I need to modify the Criteria to show the Lot Number string no matter if it the first or second Lot Number in the field? (ie. 802407, 802339 or 802339, 802407)

    Thanks

    Dave

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,914
    Use the Like operator with * on either side of your search string, which you say you have already done?, so I am puzzled as to why it would not work?

    Off to test myself.

    Edit: OK, I'm back, works for me?
    Click image for larger version. 

Name:	like.PNG 
Views:	12 
Size:	3.5 KB 
ID:	42830
    Last edited by Welshgasman; 08-27-2020 at 05:53 AM. Reason: After testing

  3. #3
    Dave14867's Avatar
    Dave14867 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Nov 2016
    Location
    Upstate NY
    Posts
    376
    I rebuilt the query and it is working now. I have had issues with some of my queries not functioning as they used to lately. I thought this was previously working but when I tried it yesterday, it didn't show everything and I thought maybe I had the criteria wrong. Sorry for the confusion.

    Thanks

    Dave

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

Similar Threads

  1. Replies: 5
    Last Post: 06-15-2018, 03:14 PM
  2. Replies: 3
    Last Post: 09-22-2016, 11:16 AM
  3. Find a record that contains a word in a string
    By knowshowrosegrows in forum Queries
    Replies: 2
    Last Post: 11-17-2015, 11:35 AM
  4. Extract part of string
    By Fais in forum Access
    Replies: 5
    Last Post: 08-06-2014, 04:46 PM
  5. Returning part of a string
    By dr4ke in forum Queries
    Replies: 7
    Last Post: 01-15-2013, 11:21 AM

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