Results 1 to 4 of 4
  1. #1
    AccessUser1234 is offline Novice
    Windows 98/ME Access 2000
    Join Date
    Apr 2010
    Posts
    2

    Help combining two quieries to output

    Hello,



    I have two quieries that I have sorted out to.
    A Table: Fields in this table are: Record Type, Number, Dept, Spaces
    B Table: Fields in this table are: Record Type, Pay Type, Shift, Week,Hours, Position, X Dept, Code, Ent

    My goal here is that I want to combine these two quieries and export them to one file. I need them to read the following in the export file.

    Record from A table
    Record from B table
    Record from A table
    Record from B table

    The B table is in relationship to the A table. I need it to read like that for each record in the quieries. I cant figure out how to do it. I can create a common identifier between the two tables (emp ID) but i still cant figure out how to do it. I have all the information there i just need to like shuffle the information, so i can get it to output correctly.

    Any Ideas would be greatly appreciated. .

    Thanks

  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,640
    Not clear on what your data looks like, but it seems like you may want a UNION query:

    SELECT Field1, Field2
    FROM Table1
    UNION ALL
    SELECT Field1, Field2
    FROM Table2
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    AccessUser1234 is offline Novice
    Windows 98/ME Access 2000
    Join Date
    Apr 2010
    Posts
    2
    Hello,

    I need my data to look like this.

    B 0000099900000892900
    C 01001000040.0001000067000
    B 0000012300000998800
    C 010001000035.000100088000

    The C record is unique to the B Record. The information is in 2 tables B and C, but i need some way to get them combined to.

    I tried to use a union query but it wasnt working. For union queries shouldnt the fields be similar? For this this fields arent similar the only common identifier is Emp ID if i would add it to the quiery.

    Everytime I tried to to the union query i kept getting a syntax error saying that it could not find record type. I am new to union queries so not sure what that means.

    Thanks for your help

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Can you post a sample db with the two tables and what the desired result is?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Field output for height?
    By emccalment in forum Access
    Replies: 1
    Last Post: 01-29-2010, 12:42 PM
  2. Insert Query output into a table
    By ammu_sridhar in forum Programming
    Replies: 1
    Last Post: 06-12-2009, 01:09 AM
  3. output of queries like to have rounded numbers
    By techexpressinc in forum Queries
    Replies: 5
    Last Post: 05-28-2009, 07:56 PM
  4. vba code for regression analysis P value output
    By Frangipani in forum Programming
    Replies: 0
    Last Post: 02-04-2009, 06:26 AM
  5. Output Query to Text
    By denileigh in forum Queries
    Replies: 1
    Last Post: 05-27-2006, 12:34 PM

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