Append only new records

G

Guest

I have a database that has a "calls" table and a "calls-history" table.
Periodically I need to dump some of the calls to the calls-history table.

How do I make sure I'm not dumping duplicate records...can I specify this as
criteria in my append query?
 
G

Guest

Use a primary key field in calls-history table.

Better yet is to have only one table with a Yes/No flag field for history.
Just add criteria to your queries for history - no (zero).
 
G

Guest

Karl,

I understand the second comment...as that would make my DB completely
normalized. However, given some other requirements it will be easier to have
a separate 'history' table and 'current' table.

So, a question about your first comment. My 'calls' table has a 'complete'
field. Primary key in calls-history is CallID.

If I append using query criteria 'complete' = yes, what happens if one of
the records has already been appended to calls-history? Does the rest of the
append stop? If warnings are turned off (run the query through a macro),
then does it append what isn't a duplicate and drop the rest?

Thanks!
 
S

Steve Schapel

Karla said:
... given some other requirements it will be easier to have
a separate 'history' table and 'current' table.

With all due respect, and without knowing the details... "easier" isn't
usually a very useful basis for data modelling decisions.
If I append using query criteria 'complete' = yes, what happens if one of
the records has already been appended to calls-history?

It doesn't get appended.
Does the rest of the
append stop?
No.

If warnings are turned off (run the query through a macro),
then does it append what isn't a duplicate and drop the rest?

Yes. Did you give it a try?
 

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