Forum Discussion

ianradcliffe's avatar
ianradcliffe
Copper Contributor
Jul 20, 2020
Solved

Multi Table (Query) Report

I am trying to create an Employee Certification Summary report that uses records from 5 different data tables/queries.  The records from separate tables/queries are as follows:   Data              ...
  • George_TD's avatar
    Jul 24, 2020

    ianradcliffe 

    I need a bit more detail about the other tables and I'm not sure exactly how you wanted the training formatted across the page, but you could do something like this.

     

    Instead of joining the training history as a table in your query with the other tables, you can get the eight training records as columns if you use the TRANSFORM command. That turns it from vertical to horizontal each person's training on one row with all the other info.

     

    Create a query using the training history table. You have to do it in SQL, like this.  Save this query and just put it in your query replacing the table.

     

    TRANSFORM First(CompletedTrainingClasses.TrainingDate) AS Training
    SELECT CompletedTrainingClasses.EmpID, First(CompletedTrainingClasses.TrainingDesc) AS FirstOfTrainingDesc
    FROM CompletedTrainingClasses
    GROUP BY CompletedTrainingClasses.EmpID
    PIVOT CompletedTrainingClasses.TrainingDesc;

     

    Each row becomes a column like below.

    ID      Exam   Educ PastExpTech ExamFirst  Second    Third          Fourth         Fifth         Sixth     Seventh

    1Eye Exam DoneEduc Doneyestech1/1/20201/15/20201/31/20202/14/20203/17/20204/12/20205/12/20206/1/2020