-
query multiple tables
I have two tables that I need to query and combine. First table is the template and has part number, group number and serial number, with serial number being blank. Second table being imported has part number, group number and serial number, which serial number is provided. I need to compare part number and group Id and have the serial number value added to template. I am new to access and not sure how to query and build a table out of two tables.
-
This is an UPDATE Query which must JOIN two tables with compound link on 2 fields: part number and group number. Use the query builder to help construct.
-
In Microsoft Access, you can use a query to combine data from multiple tables and update the serial number column in the template table with the values from the imported table. You can use an Update query to update the serial number column in the template table with the values from the imported table based on the matching part number and group Id.
Here is an example of how you can create an Update query to update the serial number column in the template table with the values from the imported table:
UPDATE template
INNER JOIN imported ON template.part_number = imported.part_number AND template.group_id = imported.group_id
SET template.serial_number = imported.serial_number;
Alternatively, you can use a SELECT query to create a new table that combines data from the two tables and includes the serial number column from the imported table.
Here is an example of how you can create a SELECT query to create a new table that combines data from the two tables and includes the serial number column from the imported table:
SELECT template.part_number, template.group_id, imported.serial_number
FROM template
INNER JOIN imported ON template.part_number = imported.part_number AND template.group_id = imported.group_id;
You can then save the query as a new table, or export it to a new table in the database. You can also use the query to create a new table in another format (e.g. excel)
Please keep in mind that the specific syntax and commands used to query and combine data from multiple tables in Microsoft Access may vary depending on the version of Access and the specific database design. It is always recommended to consult the official documentation of the product for the same.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|