Results 1 to 4 of 4
  1. #1
    zur is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Dec 2014
    Posts
    2

    Query hangs

    I have a query 'qrymainQuery' which has many subqueries

    the statement Select * from qrymainQuery hangs

    qrymainQuery is as follows
    TABLE qry1
    UNION TABLE qry2
    UNION TABLE qry3


    UNION TABLE qry4
    UNION TABLE qry5
    UNION TABLE qry6

    qrymainQuery doesn't yield a result, but all the queries qry1 to qry6 yields results when running individually.

    Can any body help in this issue. Thanks

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    The query is incomplete and should error.

    SELECT field1, field2, field3 FROM qry1
    UNION SELECT field1, field2, field3 FROM qry2
    UNION SELECT field1, field2, field3 FROM qry3
    UNION SELECT field1, field2, field3 FROM qry4
    UNION SELECT field1, field2, field3 FROM qry5
    UNION SELECT field1, field2, field3 FROM qry6;
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    zur is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Dec 2014
    Posts
    2
    There is no error.

    All quries qry1 to qr6 have similar select fields
    for ex: qr1 is select a.field1, a.field2 from table A inner join Table b on a.field3=b.field4
    qr2 is select a.field1, a.field2 from table A inner join Table c on a.field3=c.field4

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    I've never seen the syntax you posted. Did you try my suggestion? http://www.w3schools.com/sql/sql_union.asp

    If the fields in each query are in the same order and each query has the same number fields, can use * wildcard.

    SELECT * FROM qry1
    ...
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Query hangs when trying to run
    By scorpion99 in forum Access
    Replies: 1
    Last Post: 09-12-2014, 08:32 AM
  2. Module executes but then Hangs Access
    By Nishy in forum Modules
    Replies: 4
    Last Post: 02-24-2014, 06:11 PM
  3. Access front end hangs when more than one user
    By mafrank101 in forum Access
    Replies: 3
    Last Post: 05-31-2012, 10:15 PM
  4. Print Preview Hangs
    By ellenl5974 in forum Reports
    Replies: 3
    Last Post: 05-08-2012, 05:17 PM
  5. Refreshing Linked Tables Hangs
    By blamb in forum Access
    Replies: 0
    Last Post: 12-05-2011, 12:36 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