Results 1 to 5 of 5
  1. #1
    swb1 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    May 2014
    Posts
    11

    Question How to obtain the max value from two separate tables

    Hi,

    I am using Access 2007 and I have two tables (2010 & 2011). There is a common field/column in each table called 'Yearly Total'. I would like to run a query that will return the max value regardless of which table the value is retrieved from (2010 or 2011). Is this possible? If so, can someone explain?

    Thanks,

    swb1

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Why do you have two tables? Are the fields identical? If yes, should be one table with another field for the year identifier. Otherwise, build a UNION query and use the UNION query as data source in other queries.

    Must have responded to half dozen threads in 2 days that called for UNION solution. Here is one https://www.accessforums.net/queries...ery-45873.html
    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
    swb1 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    May 2014
    Posts
    11
    To answer the question, I imported the data from an excel spreadsheet that had 22 sheets in it. Each sheet imported as a new table. Maybe that was the problem. Is there a way to have all of the 22 sheets imported one time into one table? If so, can someone explain how to do it?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Should be able to. Is this a repetitive exercise or just the one-time event? If one-time then data is already in tables, just combine data to one table. The effort to figure out the 22 sheet import will probably be just as much as fixing the already imported data.
    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.

  5. #5
    swb1 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    May 2014
    Posts
    11
    You are probably right. Making the adjustments in excel will probably be easier to deal with.

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

Similar Threads

  1. Replies: 7
    Last Post: 06-19-2014, 12:00 PM
  2. Replies: 13
    Last Post: 06-05-2012, 10:46 AM
  3. Memo fields in separate tables
    By mhart in forum Database Design
    Replies: 1
    Last Post: 12-02-2011, 05:51 PM
  4. run a report from 2 separate tables
    By Kajinga in forum Reports
    Replies: 2
    Last Post: 11-23-2011, 05:08 PM
  5. New user - separate a table into two tables
    By Henry_Reimer in forum Database Design
    Replies: 19
    Last Post: 10-08-2011, 10:19 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