Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Adcock1969 is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    9

    Combine multiple Excel sheets in Access

    Hi All,



    First I'd like to say that I am new to Access.

    I have two reports that I import into Excel.They both show the locations in the warehouse where our product is supposed to be located. Over years of lack of maintenance they no longer match.

    What I would like to do is link these two sheets in Access so that the information can be updated as I progress and correct the information.
    Both have a common row or field called Locations. The problem is that some of the locations doesn't exist in both of the sheets. One of the sheets also has duplicated records for the same location.

    I assume that I need some type of query to accomplish this; but have no idea where to start.

    i have copied and pasted some samples of the information in the spreadsheets as well as the results that I am looking for.

    I would appreciate any help someone could give me.

    Sorry, my copy and paste didn't look right due to word-wrap. I have attached sreenshots of the two spreadsheets and the needed results in Access.
    Last edited by Adcock1969; 09-04-2011 at 11:23 AM. Reason: My copy and paste didn't look right due to word-wrap.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Are you able to establish links to the worksheets? If so, then try Find Unmatched query. The Query Wizard can help you build this.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Adcock1969 is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    9
    Sorry, I had to look up "find unmatched query" to see what it was. That looks similar to what I need; but I would also like to see the "matched" results as well.
    Any suggestions?

  4. #4
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Create a query with the fields you wish to display and join the two tables on the common field. Run the query, and the results will be all situations where the record appears in both tables.

    Alan

  5. #5
    Adcock1969 is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    9
    Sorry to sound so green.
    but could you tell me how I would do that?

  6. #6
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Its time to do some research. Here are a couple starting points.

    http://www.databasedev.co.uk/queries.html

    http://www.techonthenet.com/access/queries/index.php

    Post back with issues you have outlining specifically what problems you are encountering.

    You may want to get a book on Access and pore over it diligently.

    Alan

  7. #7
    Adcock1969 is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    9
    I tried joining the two tables but I end up with only the results that match in the common field.
    I have come close to the results I need with a Union Query. But with that I am still missing the record entries for the common field (Locations) in the right side of the join. Here is the SQL of the Union Query I ran. Any suggestions.


    SELECT [WMS Locations].[P CAP], [WMS Locations].[WMS DESCRIPTION], [WMS Locations].[WMS ITEM], [WMS Locations].Location, [JBA Locations].[JBA Item], [JBA Locations].[JBA Description], [JBA Locations].[U/M]
    FROM [WMS Locations] LEFT JOIN [JBA Locations] ON [WMS Locations].Location = [JBA Locations].Location
    UNION
    SELECT [WMS Locations].[P CAP], [WMS Locations].[WMS DESCRIPTION], [WMS Locations].[WMS ITEM], [WMS Locations].Location, [JBA Locations].[JBA Item], [JBA Locations].[JBA Description], [JBA Locations].[U/M]
    FROM [WMS Locations] RIGHT JOIN [JBA Locations] ON [WMS Locations].Location = [JBA Locations].Location
    WHERE [WMS Locations].Location IS NULL;

  8. #8
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Quote Originally Posted by Adcock1969 View Post
    I tried joining the two tables but I end up with only the results that match in the common field.
    I thought that was what you were asking for in the above thread.

    but I would also like to see the "matched" results as well.
    If you are looking for something different, then please be specific and indicate what fields you have and what tables and what you want the end result to look like. Perhaps attaching your database with a clear explanation would be beneficial.

    Alan

  9. #9
    Adcock1969 is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    9
    I'm sorry if I wasn't clear enough previously. I also want to thank you for all the advice and help. What I need is the matching & non-matching records from my "Locations" field from both tables ('WMS Locations' & 'JBA Locations'). Or if it's simpler to understand, I would like ALL of the records from the "Locations" fields in both tables. I have attached a sample database that has the "WMS Locations" table and the "JBA Locations" table and a table labeled "WMS & JBA Locations" with the required results. As always I appreciate any guidance that you can give me.

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    This query will return ALL records from both tables, including records that are duplicates for the selected fields. Remove the ALL keyword to eliminate duplication.

    SELECT "WMS" As Source, [P CAP], [WMS DESCRIPTION] As Description, [WMS ITEM] As Item, Location FROM [WMS Locations]
    UNION ALL
    SELECT "JBA" As Source, Null, [JBA DESCRIPTION], [JBA ITEM], Location FROM [JBA Locations];

    Doesn't quite match your example output which returns only 5 records from the total 6 and does more than just return records from the two tables.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #11
    Adcock1969 is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    9
    Hi June7,
    We use two different programs (WMS & JBA) that stores the locations of our products. Over years of no maintenance the locations in both systems no longer match. We will be using the results from the query so that we can compare the locations and products in both programs to see what needs to be corrected. As we progress, I will re-run the reports so that I can see the progress.
    Thank's for the time and the query info. I will see if I can get that to work and will post with results.

  12. #12
    Adcock1969 is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    9
    June7,
    That's great. The Union you specified gives me all of the records that I need in one place. But is there a way for it to sort the information from the WMS table and the JBA table basically side-by-side as in the example that I've attached? And again thank's for all the help.

  13. #13
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Maybe. Your data sample shows that Location is unique in WMS Location but not in JBA Location. Is this consistent?

    Try a Union query that will return all unique locations then join the two tables to the Union query. Here it is as one nested SQL.
    SELECT AllLocations.Location, [WMS Locations].[WMS DESCRIPTION], [WMS Locations].[WMS ITEM], [JBA Locations].[JBA Description], [JBA Locations].[JBA Item]
    FROM [WMS Locations] RIGHT JOIN ([JBA Locations] RIGHT JOIN
    (SELECT Location FROM [WMS Locations] UNION SELECT Location FROM [JBA Locations]) As AllLocations
    ON [JBA Locations].Location = AllLocations.Location) ON [WMS Locations].Location = AllLocations.Location;
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  14. #14
    Adcock1969 is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    9
    June7,

    Sorry I'm just now replying. That was exactly what I needed. I can't thank you enough. I am now in the process of searching the net for sites where I can learn SQL. If you have any suggestions for a beginner please post or email me at Adcock1969@yahoo.com Again, Thank you for all your help.
    Thanks to alansidman for his assistance on my journey too.
    I will mark this thread as solved later tonight.

  15. #15
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Download Excel sheets into contacts
    By magster01 in forum Access
    Replies: 1
    Last Post: 08-19-2011, 09:50 AM
  2. Exporting Queries to Excel Sheets, 1 Student per Workbook
    By StudentTeacher in forum Programming
    Replies: 8
    Last Post: 09-02-2010, 11:48 AM
  3. Export to excel different sheets
    By apsf68 in forum Access
    Replies: 2
    Last Post: 07-27-2010, 07:05 AM
  4. Import excel sheets to access.
    By calexandru in forum Import/Export Data
    Replies: 0
    Last Post: 08-19-2009, 09:44 AM
  5. Replies: 0
    Last Post: 04-29-2009, 04:27 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