Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Australia
    Posts
    676
    Thanks
    28
    Thanked 2 Times in 2 Posts

    Query parameter for multiple fields (Access 2007)

    We need a query parameter that will match a string that may exist in either of two fields. The query parameter * & Like [Enter string:] & * works if we use it twice, on the two fields separately, but it doesn't work if we concatenate the two fields Expr: [Field A]&[Field B] and use the single query parameter on it. (We need to do this twice in the same query; i.e., match one string if it exists in [Field A]&[Field B] AND match another string if it exists in [Field C]&[Field D].) Is this possible?

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Query parameter for multiple fields (Access 2007)

    What do you want to do?

    Why do you concatenate the 2 strings? What are the 2 fields?

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Query parameter for multiple fields (Access 2007)

    Shouldn't it be
    <code>
    Like "*" & [Enter string:] & "*"</code>

  4. #4
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Australia
    Posts
    676
    Thanks
    28
    Thanked 2 Times in 2 Posts

    Re: Query parameter for multiple fields (Access 20

    Sorry - my typo, I meant: Like "*" & [Enter string:] & "*". I solved this problem by splitting the query into two queries.

Posting Permissions

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