Results 1 to 3 of 3
  1. #1
    templeowls is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    305

    Parameter search in Union query

    I have a union query between two queries. The current SQL is:




    SELECT * FROM 2018Query
    UNION ALL SELECT * FROM 2019Query;


    I'd like to add a parameter search. I had one previously on a non-union query that worked perfectly, but this was in design view and idk how to add this to SQL View. In the criteria cell in the non-union query, I had:


    Like "*" & [Search text] & "*"

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Same answer as given elsewhere

    SELECT * FROM 2018Query
    WHERE FieldName Like...
    UNION ALL
    SELECT...
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Another option is to save the original Union query with no parameters.
    Then, create another query based off of that Union query, and you will be able to use the Query Builder and add the criteria like you are used to.
    (There is nothing wrong with doing a query of a query).

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

Similar Threads

  1. Parameter Union Queries
    By ballaterach in forum Queries
    Replies: 2
    Last Post: 12-15-2018, 11:20 AM
  2. Replies: 4
    Last Post: 08-09-2017, 12:06 PM
  3. Replies: 5
    Last Post: 08-09-2017, 01:16 AM
  4. Replies: 10
    Last Post: 09-08-2016, 08:09 PM
  5. Replies: 5
    Last Post: 02-10-2014, 04:46 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