Before we create the Make Table Query, you might like to create a new blank database file. This is so we have a separate database into which we can paste the new table from the query. In this exercise I have called it HistoricData.accdb.
Here is the procedure to create a Make Table Query:
- Open the database which we are going to query (in my case, this is the Order Management System).
- Click the QUERY DESIGN icon (located in the OTHER group of the CREATE ribbon).
- Select the tables to be used from the SHOW TABLE dialog form. I have selected tblCustomer, tblOrganisation, tblPerson and tblAddress.
- Next select all the fields from the existing tables to be used in the query. These not only form the query results, but also the structure for the new table. I have chosen fields from all four tables so that the new table will be self sufficient.
- Amend the table relationships (or Joins) as required.
- Click the MAKE TABLE icon (located in the QUERY TYPE group of the DESIGN ribbon). This opens the MAKE TABLE dialog form (see Figure 1 below).
- Enter the name of the new table that we are going to create. I have called mine tblCustomerTeamsMay2012.
- Click the option button for ANOTHER DATABASE. This ensures the new table will be created in a different database.
- Browse to the location of the external database. I have called mine HistoricData.accdb. Double click the file to select and then click OK to close the dialog form.
- Test the Query by clicking the DATASHEET VIEW icon (located in the RESULTS GROUP of the DESIGN ribbon).
- If you are happy with the data displayed, you can run the Make Table Query by clicking the RUN icon (located in the RESULTS group of the DESIGN ribbon). This will now create the new table in the external database.
You can now open the external database and view the newly created table:
Now all the database administrator has to do is run this query every month, changing the new table to the appropriate month. Over time, we collect a ‘warehouse’ of data ready to be accessed if and when needed. Since this data is stored in a separate database, it does not impact upon the performance of the actual system from which the information was collected.