Search a record similar to LIKE function?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kathnicole
    New Member
    • Mar 2007
    • 33

    Search a record similar to LIKE function?

    Hi All,

    I would like to retreive all the records that starts, where the field CompanyName in table tblJob start with "sap*"... i assume this can be acheived by using LIKE function in query design but i want the user to enter the text.

    Say, there are two company Names like "sapin" and "sapeen"

    when the user enters the text as "sap", it should list all the records where the company name starts with Sap..

    and again, if the user enters, "ABC", i want access to list all records where the company name starts with ABC.

    Any help in this regard.

    thanks,
    Kathy
  • kepston
    Recognized Expert New Member
    • May 2007
    • 97

    #2
    Originally posted by kathnicole
    Hi All,

    I would like to retreive all the records that starts, where the field CompanyName in table tblJob start with "sap*"... i assume this can be acheived by using LIKE function in query design but i want the user to enter the text.

    Say, there are two company Names like "sapin" and "sapeen"

    when the user enters the text as "sap", it should list all the records where the company name starts with Sap..

    and again, if the user enters, "ABC", i want access to list all records where the company name starts with ABC.

    Any help in this regard.

    thanks,
    Kathy
    You can use a parameter query. Access will prompt for an unrecognised field name.
    [CODE=sql]SELECT *
    FROM tblJob
    WHERE CompanyName Like [Prompt for beginning of company name] & '*';[/CODE]

    Comment

    • abolos
      New Member
      • Apr 2007
      • 65

      #3
      Originally posted by kathnicole
      Hi All,

      I would like to retreive all the records that starts, where the field CompanyName in table tblJob start with "sap*"... i assume this can be acheived by using LIKE function in query design but i want the user to enter the text.

      Say, there are two company Names like "sapin" and "sapeen"

      when the user enters the text as "sap", it should list all the records where the company name starts with Sap..

      and again, if the user enters, "ABC", i want access to list all records where the company name starts with ABC.

      Any help in this regard.

      thanks,
      Kathy
      Open a query and in Criteria write:

      Like text0 & "*"

      Comment

      • kathnicole
        New Member
        • Mar 2007
        • 33

        #4
        Thanks a lot. i was surprised to see the result.

        it works good.

        thanks n regards,
        Kathy

        Comment

        • kepston
          Recognized Expert New Member
          • May 2007
          • 97

          #5
          Originally posted by kathnicole
          Thanks a lot. i was surprised to see the result.

          it works good.

          thanks n regards,
          Kathy
          Always glad to help.

          Comment

          Working...