Query

Humanski

Registered User.
Local time
Today, 10:29
Joined
Aug 26, 2002
Messages
13
What kind of query would I need to run if I wanted to compare data in one table to another, e.g

If Inv_no 1234 in table 1 is in Table 2 then do not export or import into table 3

Thanks
 
you need to create a link between the fields that you want to compare on. basically, in the query design window, add the two tables you want to compare. click the field you want to compare on in one fieldlist and drag it to the appropriate field in the other fieldlist.

Just add all the fields to the query from one of the tables in the normal way.

I would recommend a using a make-table query for this purpose.

cyberz
 
If you specifically want to find records that aren't in table 2 then when you've joined the appropoiate fields, change the join type (double click on the link) to include all fields from table 1 and those from table 2 where they also occur. Then you can select all the fields from table 1, using the criterion "is null" in one of the fields from table 2.

The result of all this is that you'll then select all those records from table 1 that don't occur in table 2 - these are presumably the ones you will want to import into table 3. Save this query.

Then make a new (append) query if table 3 already exists (or a make-table as cyberz says if it doesn't) and append/import the results of your previous query into it.
 

Users who are viewing this thread

Back
Top Bottom