Table help

B

Bob Parr

I have a query that I have created to pull data from 3 tables that I cannot
edit. That is I don't own the tables so I cannot modify them. What I am
looking for is a way to keep track of the records tha I have printed, so I
don't print them again. The only way I can think to do this is have another
table that keeps track of the records I have printed. Is there an easier
way to do this, and what would be the easiest way to check the records from
one table against the other.

Bob
 
M

Marshall Barton

Bob said:
I have a query that I have created to pull data from 3 tables that I cannot
edit. That is I don't own the tables so I cannot modify them. What I am
looking for is a way to keep track of the records tha I have printed, so I
don't print them again. The only way I can think to do this is have another
table that keeps track of the records I have printed. Is there an easier
way to do this, and what would be the easiest way to check the records from
one table against the other.

If you can not modify the original records, then you'll have
to have another table to keep track of it. I suggest that
the new, Printed table have at least two fields: the PK of
the original record and the data/time that it was printed.

The easiest way to check the records from one table to
another is to Join the two tables in a query. An Inner Join
will only return records where the connecting field exists
in both tables.
 
B

Bob Parr

The problem with InerJoin, is that I would want the records that have not
been printed. That is the records that did not exist in in printed table.

Bob
 
M

Marshall Barton

Bob said:
The problem with InerJoin, is that I would want the records that have not
been printed. That is the records that did not exist in in printed table.

In that case use what's sometimes called a frustrated outer
join:

SELECT Maintable .*
FROM Maintable Left Join Printed
ON Maintable.ID = Printed.ID
WHERE Printed.ID Is Null



 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top