Results 1 to 8 of 8
  1. #1
    Jerseynjphillypa is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Apr 2012
    Posts
    83

    Combing two tables together

    I have two tables called Data1 and Data2 with the same fields.

    I want to include all the DateEnter fields from both tables by ItemName.
    So if the date matches both tables, I want to pull the Data1Total and Data2Total into one table by ItemName and DateEnter.

    But if a date is on one table and not the other, I also want to pull the respective Data1Total or Data2Total according to the DateEnter off the table




    The fields I want for the new table to pull data off the two tables are DateEnter,ItemName,Data1Total, and Data2Total.
    Attached Files Attached Files

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Can you attach a mdb version of your db for those of us that are not using A2007 or A2010.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    Jerseynjphillypa is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Apr 2012
    Posts
    83
    No problem..
    Attached Files Attached Files

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Not sure that I really understand your required result but take a look at the attached db. I have created a union query which I have then used to create a Totals query. Does this give the required result.
    Attached Files Attached Files
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    Jerseynjphillypa is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Apr 2012
    Posts
    83
    Thanks for your help Bob Fitz.

    Everything was great but I would like to separate the Total with two columns called Data1Total and Data2Total like the table I created in the db.

    So if the Data1total is coming for Data1 Table that's where the data will go and if the Data1total is coming for Data2 table that's where the data will go in the
    qryTotals table

    Also how to expert the UnionJoin into a table

  6. #6
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Hopfully the attached db will have what you require.
    Take a look at the query "qryBothTotals"
    Attached Files Attached Files
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  7. #7
    Jerseynjphillypa is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Apr 2012
    Posts
    83
    thank you for all your help Bob Fitz

  8. #8
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    You're welcome. Glad to help.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

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

Similar Threads

  1. Macro Help with Combing Table with Date Query
    By Jerseynjphillypa in forum Programming
    Replies: 15
    Last Post: 05-03-2012, 10:25 AM
  2. Replies: 3
    Last Post: 04-10-2012, 02:36 PM
  3. Replies: 3
    Last Post: 01-05-2012, 12:04 PM
  4. Replies: 10
    Last Post: 07-12-2011, 11:09 PM
  5. Joining tables two tables and another table that is not
    By DevintheDude in forum Database Design
    Replies: 0
    Last Post: 09-12-2007, 08:56 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