Update or Append? (1 Viewer)

sladetroityer

Registered User.
Local time
Today, 08:44
Joined
Oct 26, 2011
Messages
149
I have a department number table in my database and I want to add new department numbers from a imported table. How is this accomplised? There are 256 department numbers in my existing table and 272 department numbers in the imported table. How do I add the new ones only?:confused:
 

plog

Banishment Pending
Local time
Today, 10:44
Joined
May 11, 2011
Messages
11,695
1. Backup up your current table with Department numbers in it (for reference I am going to call this table 'DeptNums').

2. Import the new ones into a table named something like 'newDeptNums'.

3.Bring that table into a query along with the current table that has Department Numbers.

4.Join those two tables on the department number field, then change that join to include all rows of data from tempDeptNums.

5. Bring down the department number field from DeptNums and set the criteria to Null

6. Bring down department number field from newDeptNums along with any other fields you want to add.

7. Run this query to verify it is showing just new data.

8. Go back into design view and make this an append query and append the data to DeptNums.

9. Execute the query and your done.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 16:44
Joined
Sep 12, 2006
Messages
15,755
you need "append" to add new items

if the dept number is a unique field (eg primary key) then either

a) do an unmatched query, and append the new values

or
b) try and append everything, and access will reject the duplicates

-----
now if the dept numbers have accompanying names, then you need an UPDATE query to update the names for all the existing dept numbers.
 

Users who are viewing this thread

Top Bottom