Results 1 to 4 of 4
  1. #1
    mkfloque is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jan 2012
    Posts
    24

    SQL Question: Union Query

    Hello All. I have 6 different queries i need to join. There's only one common field (numerical month) among all the queries.


    I'd like all numerical months to fall into a numerical month row (not combine them!). And have all the other fields be separate columns (no combining!).

    I'm not sure of the syntax, though.

    Any help would be appreciated, thanks

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,421
    not sure what you are asking - each subquery within a union query must return the same number and datatype of columns.

    Perhaps provide some example data and an example of the resultant outcome required

  3. #3
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    You would select all the fields from each table, then use inner joins to link the tables on the month number. An easy way to do this would be to create the query in query builder, then copy the SQL to wherever you need to use it (though it will need some cleaning up to remove CR's).

  4. #4
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Careful of the inner join - all queries MUST then have the same list of months, not always true.

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

Similar Threads

  1. Replies: 4
    Last Post: 12-20-2015, 02:35 PM
  2. Sum in Union Query
    By beckysright in forum Queries
    Replies: 3
    Last Post: 07-23-2013, 12:06 PM
  3. Table Union Question
    By Caulerpa in forum Queries
    Replies: 5
    Last Post: 01-14-2013, 03:02 PM
  4. Replies: 8
    Last Post: 10-22-2012, 07:43 PM
  5. Union Query Question
    By jpkeller55 in forum Access
    Replies: 2
    Last Post: 09-24-2010, 10:18 AM

Tags for this Thread

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