Results 1 to 10 of 10
  1. #1
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155

    Combining Tables by Query

    Good Morning,



    I have two tables with similar information (they are too big to combined). In a query I want the name and the score to appear. (The form has questions with scores and names) I want to combined them so its one continues table (Names for both Table 1 & 2 and scores from both 1 & 2) Is this possible? I can set up a sample if that helps!

    Thanks,

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    they're too big for a union?

  3. #3
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    If you mean copying the fields and putting them in one table, then yes...its exceeds the 255 field limit. I have a book for Access 2003. I'm researching this Union thing you mentioned. Its using SQL? I would create two queries with the data needed and matching from both tables? What would I do from there? Im having trouble understanding what the book is telling me...is it possible I can create a sample and someone help me with it?

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    unions are for RECORDS, not fields.

    you want students and scores in one table? what are we talking about here? student and score info across fields or down records?

    if they're across fields, the structure is pretty bad. move it back to excel and transpose the information so it's vertical and then import it back into access. that might be your best bet to get it into database-friendly structure, actually

  5. #5
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    For the sake of size limits I deleted a lot of fields but the main ones I need are there. It will be easier to explain this way. If you notice, Query 1 and Query 2 have the same exact field names (but from different tables) and the information stored in those tables are the same type. I need to compile a list that has both of the queries together...is that possible? I want to create it down records not across fields.

  6. #6
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    why not this:
    Code:
    SELECT Table2.Date, Table2.Name, Table2.[Cert #], Table2.Score
    FROM Table2
    
    UNION
    
    SELECT Table1.Date, Table1.Name, Table1.[Cert #], Table1.Score
    FROM Table1;

  7. #7
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    Got it. Thanks!

  8. #8
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by jlclark4 View Post
    Got it. Thanks!
    no problem, bud. congrats! =)

  9. #9
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    Can you not use the Union to join two queries?

    Code:
    SELECT qryCDSC.Date, qryCDSC.Name, qryCDSC.TeamLead, qryCDSC.Manager, qryCDSC.[Cert #], qryCDSC.Score
    FROM qryCDSC
    UNION 
    SELECT qryCDSI.Date, qryCDSI.Name, qryCDSI.TeamLead, qryCDSI.Manager, qryCDSI.[Cert #], qryCDSI.Score
    FROM qryCDSI,
    It gave me "Syntax error in FROM clause"

  10. #10
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    I figured it out! Sorry I used , instead of ;

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

Similar Threads

  1. Combining Tables into one table
    By softspoken in forum Access
    Replies: 2
    Last Post: 04-22-2010, 02:37 PM
  2. combining 2 tables
    By psrs0810 in forum Access
    Replies: 11
    Last Post: 01-07-2010, 08:55 AM
  3. Combining Tables
    By king_bowzow in forum Queries
    Replies: 0
    Last Post: 08-05-2009, 10:15 AM
  4. Replies: 1
    Last Post: 06-03-2006, 05:02 PM
  5. Help combining 3 tables
    By luscioussarita in forum Queries
    Replies: 1
    Last Post: 12-14-2005, 03:22 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