473,395 Members | 1,931 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

append query - nonduplicate records

78
OK, I am pulling my hair out on this one. It seems like it should be so simple and I cannot seem to find the answer.

I am using Access 2000 on Windows 2000.

I have two tables set up. Table One is updated Daily, Table Two is going to keep a running tally of Data.

What I need to do is add records form Table One into Table Two. However, I only want to add records that do not exist.

Here is the tricky part. The data in Table One is not identical to Table Two. I need to have it look at 6 columns in Table One and the same in Table Two. If they are Different (all six fields) then Add the record to Table Two.

I cannot find the correct sequence to write to make this happen.

I have tried playing with a regular query to show me the records that do not match(non-duplicate). I can have it show me all files that do, but cannot figure out how to show records that do not match.

The Matching fields are all text fields. Some have numbers, but because of the information they need to saved as text.

Any help is greatly appreciated. Any questions about the information please do not hesitate to ask. Thank you in advance for your help.

Nick
Nov 26 '08 #1
2 2440
ChipR
1,287 Expert 1GB
You need to use the EXISTS SQL condition, or the NOT EXISTS actually. There are some examples here:
SQL: EXISTS Condition

So something like

SELECT * FROM Table1 WHERE NOT EXISTS _
(SELECT Column1, Column2, Column3, Column4, Column5, Column6 _
FROM Table2 Where _
Table2.column1 = Table1.column1 AND Table2.column2 = Table1.column2 AND Table2.column3 = Table1.column3 AND Table2.column4 = Table1.column AND Table2.column5 = Table1.column5 AND Table2.column6 = Table1.column6)
Nov 26 '08 #2
nspader
78
Thank you for that. That was exactly what I needed. I never new about "Exists" statement. I still have lots to learn!! Thank you for your help. Sorry for the delayed response. Off work for the weekend.
Dec 1 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: JMCN | last post by:
hi i have a general question regarding append queries in access 97. each week i need to update my table(tblonlinereg) with new or modified records. firstly, i import the text file into my...
3
by: Larry Rekow | last post by:
As part of a macro, I'm trying to automate appending a table with new records. let's say the table 2 has some new records in it, but also has a lot of identical records to table 1. I would...
3
by: JOEP | last post by:
What do I need to do to allow an append query to post null values to records in a field of the destination table? Basically I want to allow records with null values to post to the table. The append...
5
by: Michael C via AccessMonster.com | last post by:
Hello, I have a table that I am appending 3 seperate tables into. My main problem is that each time I append the data, it simply adds to the data already there. That might sound ok, except that...
5
by: solar | last post by:
I have copied a function that appends from table orders2 into table orders1 the row that has the value SubOrder = True in the table orders2. This function finds the highest ordered in the table...
4
by: MN | last post by:
I have to import a tab-delimited text file daily into Access through a macro. All of the data needs to be added to an existing table. Some of the data already exists but may be updated by the...
4
by: pmacdiddie | last post by:
I have an append query that needs to run every time a line item is added to a subform. The append writes to a table that is the source for a pull down box. Problem is that it takes 5 seconds to...
1
by: hr833 | last post by:
hi.. i'm using a append query to filter some new records that must be updated in the lookup table. In this lookup table it consist of the part number and the type of the product. the part number...
7
by: wade.wall | last post by:
Hi all, I am having a problem appending data to an existing table. I have two tables with identical fields and I want to append the data from one table (T2) to the first (T1). T1 has 136...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.