Results 1 to 2 of 2
  1. #1
    muppsy007 is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2010
    Posts
    1

    Union Query Ordering/Sorting

    Hi,



    I am having trouble trying to order the results of a Union query, which is in turn based on 2 other Union queries and one table query.

    The reason for this is because each of the 2 Union queries collate data from 5 tables each, and perform their own sorting. The single table query simply holds a separator record of various characters.

    Here is the SQL for the final Union Query:

    Code:
    SELECT  *, Name
    FROM Q000_DepositUnion_UnProcessedTransLive
    UNION SELECT *
    FROM Q000_Separator_UnProcessedTrans
    UNION SELECT *
    FROM Q000_DepositUnion_UnProcessedTransArchive;
    So there we have the first Union Query, followed by the separator, followed by the second Union Query. No Order applied.

    I expected the result set to display as they are defined in the query, but they don't. They seem to order by the first column of the result set.

    I have done searches on Native ordering with no luck. Does anyone know if there is a way to Order By the declaration order of the objects?

    Aaron

  2. #2
    ConneXionLost's Avatar
    ConneXionLost is offline Simulacrum
    Windows XP Access 2003
    Join Date
    Jan 2010
    Location
    Victoria, Canada
    Posts
    291
    Maybe this will help:

    Sort Order of Union Queries

    Cheers,

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

Similar Threads

  1. Please help me out with union query
    By radicrains in forum Access
    Replies: 1
    Last Post: 10-29-2010, 01:48 AM
  2. Union Query Question
    By jpkeller55 in forum Access
    Replies: 2
    Last Post: 09-24-2010, 10:18 AM
  3. Ordering data from a query
    By kulanga in forum Queries
    Replies: 9
    Last Post: 03-24-2010, 08:16 AM
  4. Need help with a Union Query
    By jdowdy in forum Access
    Replies: 1
    Last Post: 10-13-2009, 05:24 PM
  5. Replies: 5
    Last Post: 06-30-2009, 09:30 AM

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