Creates a make-table query (make-table query: A query (SQL statement) that creates a new table and then creates records (rows) in it by copying records from an existing table.).
Syntax
SELECT field1[, field2[, ...]] INTO newtable [IN externaldatabase]
FROM source
The SELECT...INTO statement has these parts:
Remarks
You can use make-table queries to archive records, make backup copies of your tables, or make copies to export to another database or to use as a basis for reports that display data for a particular time period. For example, you could produce a Monthly Sales by Region report by running the same make-table query each month.
Notes
- You may want to define a primary key (primary key: One or more fields (columns) whose values uniquely identify each record in a table. A primary key cannot allow Null values and must always have a unique index. A primary key is used to relate a table to foreign keys in other tables.)
for the new table. When you create the table, the fields in the new table inherit the data type (data type: The characteristic of a field that determines what type of data it can hold. Data types include Boolean, Integer, Long, Currency, Single, Double, Date, String, and Variant (default).)
and field size of each field in the query's underlying tables, but no other field or table properties are transferred.
- To add data to an existing table, use the INSERT INTO
statement instead to create an append query (append query: An action query that adds the records in a query's result set to the end of an existing table.).
- To find out which records will be selected before you run the make-table query, first examine the results of a SELECT
statement that uses the same selection criteria.