Query Question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Alireza355
    New Member
    • Feb 2009
    • 86

    Query Question

    Dear all,

    I am tring to have a query that returns all the rows beginning with a character to the end of the table.

    Example:

    Alfa
    Beta
    Charlie
    David
    Easy
    Fox
    Golf
    Honey

    results I want is: when entering as criteria: D

    David
    Easy
    Fox
    Golf
    Honey

    I tried using this: Like [forms]![frmSearch]![txtSearchField] & "*"

    But this only returns all items starting with D

    Thanx a lot.
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    Originally posted by Alireza355
    Dear all,

    I am tring to have a query that returns all the rows beginning with a character to the end of the table.

    Example:

    Alfa
    Beta
    Charlie
    David
    Easy
    Fox
    Golf
    Honey

    results I want is: when entering as criteria: D

    David
    Easy
    Fox
    Golf
    Honey

    I tried using this: Like [forms]![frmSearch]![txtSearchField] & "*"

    But this only returns all items starting with D

    Thanx a lot.
    Try the following as a Criteria:
    Code:
    >=[Forms]![frmSearch]![txtSearchField] & "*"

    Comment

    • Alireza355
      New Member
      • Feb 2009
      • 86

      #3
      Thanx a lot

      Thank you so much.

      It worked...

      Comment

      • ADezii
        Recognized Expert Expert
        • Apr 2006
        • 8834

        #4
        Originally posted by Alireza355
        Thank you so much.

        It worked...
        You are quite welcome.

        Comment

        • OldBirdman
          Contributor
          • Mar 2007
          • 675

          #5
          Isn't the trailing "*" superfluous? Searching for >="R" or >="R*" would be the same because * is lower than "A" in the ASCII table. If the * is a wildcard character, doesn't if have to be used with the keyword "Like"?

          Comment

          • ADezii
            Recognized Expert Expert
            • Apr 2006
            • 8834

            #6
            Originally posted by OldBirdman
            Isn't the trailing "*" superfluous? Searching for >="R" or >="R*" would be the same because * is lower than "A" in the ASCII table. If the * is a wildcard character, doesn't if have to be used with the keyword "Like"?
            I think you may be right on this one OldBirdman, nice catch! BTW, no luck on Downloading the DB, so I gave you my E-Mail Address as a Reply to your PM.

            Comment

            Working...