G
Guest
Hi. I am very new to access, and I want to copy data from multiple tables
into one table, based on criteria and such. I have tried an append query,
and I do not think that it will work.
I have many tables, but these are those that are involved:
- Departments: which has an autonumber Department ID, Department Name, and a
dealer code (from a Dealer table one-to-many)
- Temp: which has a Dealer Code and staff name, etc. Temp is unrelated to
any other table.
This is the one that I need to be filled:
- Staff: which has an autonumber Staff ID, the one-to-many Department ID
from Departments, and names, etc.
Each dealer code has three entries in the "Departments" table. What I want
to do is fill in the Staff table from previously created and filled tables.
However, the problem is that I need to get the correct Department ID
autonumber for each entry in the Staff table. The logic in this is that I
need the "Dealer Code" from the Department table and temp table to match AND
I need the Department Name from the Department table to be "Parts" (so it
just selects 1 of the 3 departments for each dealer).
When that happens, I want a sort of "merge" with that Department ID and the
information from the Temp table. I am thinking right now that I have to do
some type of Union query or inner join, both of which I have no idea how to
do.
Is what I want to do even possible, and if so, can someone provide a bit of
guidance? (I do not know SQL at all, so I think it I attempted to do
something like this it would be very messy).
Thanks!
into one table, based on criteria and such. I have tried an append query,
and I do not think that it will work.
I have many tables, but these are those that are involved:
- Departments: which has an autonumber Department ID, Department Name, and a
dealer code (from a Dealer table one-to-many)
- Temp: which has a Dealer Code and staff name, etc. Temp is unrelated to
any other table.
This is the one that I need to be filled:
- Staff: which has an autonumber Staff ID, the one-to-many Department ID
from Departments, and names, etc.
Each dealer code has three entries in the "Departments" table. What I want
to do is fill in the Staff table from previously created and filled tables.
However, the problem is that I need to get the correct Department ID
autonumber for each entry in the Staff table. The logic in this is that I
need the "Dealer Code" from the Department table and temp table to match AND
I need the Department Name from the Department table to be "Parts" (so it
just selects 1 of the 3 departments for each dealer).
When that happens, I want a sort of "merge" with that Department ID and the
information from the Temp table. I am thinking right now that I have to do
some type of Union query or inner join, both of which I have no idea how to
do.
Is what I want to do even possible, and if so, can someone provide a bit of
guidance? (I do not know SQL at all, so I think it I attempted to do
something like this it would be very messy).
Thanks!