Results 1 to 4 of 4
  1. #1
    kelkan is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Dec 2012
    Posts
    26

    Anyway to display data from two unrelated tables without creating another table?

    I have a database with several tables. One is tblEmployees (primary key is EMPLOYEEID) and it lists information about assigned employees. A second table is called tblCourses (primary key COURSEID) and lists all of the available courses an employee can take. Many of the classes are mandatory for employees to complete each year while others are optional. I have a third table called tblTraining (primary key TRAININGID) which combines the employees and courses into one table; however, this table is only populated as employees are signed up for or complete a class. I have a one-to-many relationship between tblEmployees and tblTraining. I have a one-to-many relationship between tblCourses and tblTraining. I am trying to create a document (query, form, whatever) that can combine the employees with all of the required classes so that I can see which employees have completed/still have to complete required classes. tblTraining only lists classes already taken or signed up for....The information I need to determine who has/has not taken all required classes lies in tblCourses and tblEmployees but I have no relationship between the two. The only answer to this puzzle that I can figure out is to have another table called tblRequired (primary key REQUIREDID) and Dlookup names from tblEmployees and then manually create a record with each employee in it, then have fields for each of the required classes as a yes/no field. Suggestions for an easier way to do this?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,919
    Try:
    Create a query with tblEmployees and tblCourses without a join. This will cause every record in each table to join with every record in the other table. This gives a dataset of every possible employee/course combination. Then join that query to tblTraining, jointype "Include all records from [query] and only those from tblTraining ...", do a compound join on employeeID and courseID fields.
    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
    kelkan is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Dec 2012
    Posts
    26
    I created the query for tblCourses and tblEmployees and created a dataset for all combinations. I don't understand what you mean by join that query to tblTraining. Do i join them in another query or directly to tblTraining? Do I only need to use EMPLOYEEID and COURSEID from the query I created or what? Thanks for your time to help me out.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,919
    Build two queries:

    Query 1
    with tblCourses and tblEmployees

    Query 2
    with No.1 query and tblTraining, compound join on employeeID and courseID fields, jointype "Include all records from query1..."

    Now should be able to see employee/course combinations not in tblTraining.
    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.

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

Similar Threads

  1. two unrelated tables and parameter query
    By Seito in forum Queries
    Replies: 2
    Last Post: 09-12-2011, 03:01 PM
  2. Combining results from unrelated tables
    By jwreding in forum Queries
    Replies: 7
    Last Post: 08-12-2011, 01:19 PM
  3. Combine two unrelated tables with the same fields
    By lghovden06 in forum Queries
    Replies: 4
    Last Post: 07-27-2010, 03:36 PM
  4. Replies: 27
    Last Post: 10-17-2009, 10:58 AM
  5. Replies: 1
    Last Post: 07-07-2009, 01:00 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